v3d: fix resource leak in error path

Do not leak pipe resource if scanout resource creation fails.

Fixes: bf6973199d ("v3d: Allow the UIF modifier with renderonly.")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10643>
(cherry picked from commit 66bf683ca9)
This commit is contained in:
Juan A. Suarez Romero 2021-04-30 12:49:59 +02:00 committed by Eric Engestrom
parent 0c3328ef09
commit 2ef356c0c7
2 changed files with 2 additions and 2 deletions

View file

@ -166,7 +166,7 @@
"description": "v3d: fix resource leak in error path",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "bf6973199d186c93da35becc695db58fd3d1b4e5"
},

View file

@ -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);