From 66bf683ca9b5889aa05c32d3e35ea2649bab7d23 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Fri, 30 Apr 2021 12:49:59 +0200 Subject: [PATCH] v3d: fix resource leak in error path Do not leak pipe resource if scanout resource creation fails. Fixes: bf6973199d1 ("v3d: Allow the UIF modifier with renderonly.") Reviewed-by: Iago Toral Quiroga Signed-off-by: Juan A. Suarez Romero Part-of: --- src/gallium/drivers/v3d/v3d_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c index c45c9073b88..350bedaa57d 100644 --- a/src/gallium/drivers/v3d/v3d_resource.c +++ b/src/gallium/drivers/v3d/v3d_resource.c @@ -808,7 +808,7 @@ v3d_resource_create_with_modifiers(struct pipe_screen *pscreen, if (!rsc->scanout) { fprintf(stderr, "Failed to create scanout resource\n"); - return NULL; + goto fail; } assert(handle.type == WINSYS_HANDLE_TYPE_FD); rsc->bo = v3d_bo_open_dmabuf(screen, handle.handle);