OSDN Git Service

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 940fb9c..a725aed 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 228fece..89558ee 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 c81d895..1ff9f19 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 2ab51c8..7c0f605 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;
    }