From f2fc5dece93019f0bab203247985cf350d541156 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Wed, 25 Sep 2019 12:48:57 -0700 Subject: [PATCH] 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 --- src/gallium/drivers/iris/iris_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.30.2