nouveau: fix frees in unsupported IR error paths.
authorDave Airlie <airlied@redhat.com>
Tue, 18 Jun 2019 21:10:13 +0000 (07:10 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 18 Jun 2019 22:32:19 +0000 (08:32 +1000)
This is pointless in that we won't ever hit those paths in real life,
but coverity complains.

Fixes: f014ae3c7cce ("nouveau: add support for nir")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv50/nv50_program.c
src/gallium/drivers/nouveau/nv50/nv50_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_program.c
src/gallium/drivers/nouveau/nvc0/nvc0_state.c

index 940fb9ce25ca85d6a1ae6e869f3cd3ff67af6e38..a725aedcd8e85f319d2dd897ef7e2d27f747532c 100644 (file)
@@ -346,6 +346,7 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset,
       break;
    default:
       assert(!"unsupported IR!");
+      free(info);
       return false;
    }
 
index 228feced5d1785a1074e0d22f77ab48af1c7c0a5..89558ee442f6aa52d145c24c41dedf128ad03d10 100644 (file)
@@ -768,6 +768,7 @@ nv50_sp_state_create(struct pipe_context *pipe,
       break;
    default:
       assert(!"unsupported IR!");
+      free(prog);
       return NULL;
    }
 
@@ -864,6 +865,7 @@ nv50_cp_state_create(struct pipe_context *pipe,
       break;
    default:
       assert(!"unsupported IR!");
+      free(prog);
       return NULL;
    }
 
index c81d8952c98c7e80d9c3023c95d17a110f629e19..1ff9f19f139a62cedab361df33c635a6cdd48807 100644 (file)
@@ -594,6 +594,7 @@ nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset,
       break;
    default:
       assert(!"unsupported IR!");
+      free(info);
       return false;
    }
 
index 2ab51c8529e303c5437ed32040e4d9c45d5544aa..7c0f605dc16db4b8f79110a5f2055c6b9f3e8640 100644 (file)
@@ -607,6 +607,7 @@ nvc0_sp_state_create(struct pipe_context *pipe,
       break;
    default:
       assert(!"unsupported IR!");
+      free(prog);
       return NULL;
    }
 
@@ -739,6 +740,7 @@ nvc0_cp_state_create(struct pipe_context *pipe,
       break;
    default:
       assert(!"unsupported IR!");
+      free(prog);
       return NULL;
    }