From: Nanley Chery Date: Wed, 25 Sep 2019 19:48:57 +0000 (-0700) Subject: iris: Don't leak the resource for unsupported modifier X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2fc5dece93019f0bab203247985cf350d541156;p=mesa.git iris: Don't leak the resource for unsupported modifier Make sure the res struct is free'd before returning. Fixes: 2dce0e94a3d ("iris: Initial commit of a new 'iris' driver for Intel Gen8+ GPUs.") Reviewed-by: Sagar Ghuge Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index ecf63f49ade..a45bcdb71ae 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -781,7 +781,7 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen, } else { if (modifiers_count > 0) { fprintf(stderr, "Unsupported modifier, resource creation failed.\n"); - return NULL; + goto fail; } /* Use linear for staging buffers */