iris: Don't leak the resource for unsupported modifier
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 25 Sep 2019 19:48:57 +0000 (12:48 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Mon, 28 Oct 2019 17:47:06 +0000 (10:47 -0700)
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 <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_resource.c

index ecf63f49ade3e5f49366adbefa36069dae17edcd..a45bcdb71ae028fe4f91040ece2955a5eb5e5bfe 100644 (file)
@@ -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 */