From: Lionel Landwerlin Date: Fri, 6 Mar 2020 13:57:40 +0000 (+0200) Subject: iris: properly free resources on BO allocation failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd3e50545339ffd4f258437d6282e2cfbf113725;p=mesa.git iris: properly free resources on BO allocation failure Signed-off-by: Lionel Landwerlin Cc: Reviewed-by: Adam Jackson Reviewed-by: Rafael Antognolli Part-of: --- diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 8a3a9a87f7a..50f01d350cf 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -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;