iris: properly free resources on BO allocation failure

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4086>
This commit is contained in:
Lionel Landwerlin 2020-03-06 15:57:40 +02:00
parent 7aa6720ba4
commit bd3e505453
1 changed files with 2 additions and 2 deletions

View File

@ -973,7 +973,7 @@ iris_resource_from_user_memory(struct pipe_screen *pscreen,
user_memory, templ->width0,
IRIS_MEMZONE_OTHER);
if (!res->bo) {
free(res);
iris_resource_destroy(pscreen, &res->base);
return NULL;
}
@ -1016,7 +1016,7 @@ iris_resource_from_handle(struct pipe_screen *pscreen,
unreachable("invalid winsys handle type");
}
if (!res->bo)
return NULL;
goto fail;
res->offset = whandle->offset;