summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache/cso_context.c
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2016-07-12 22:48:28 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-08-24 11:35:05 +0100
commit9411eb67ecebfc76c909ca81b09e6e7fe08ac8eb (patch)
tree51fefa514988b23a6bdb26e0668b335cf424d1be /src/gallium/auxiliary/cso_cache/cso_context.c
parent2f86582b92425d819aaeaf5d86b71e8460944093 (diff)
downloadexternal_mesa3d-9411eb67ecebfc76c909ca81b09e6e7fe08ac8eb.zip
external_mesa3d-9411eb67ecebfc76c909ca81b09e6e7fe08ac8eb.tar.gz
external_mesa3d-9411eb67ecebfc76c909ca81b09e6e7fe08ac8eb.tar.bz2
gallium/cso: avoid unnecessary null dereference
The label `out:` calls `destroy()` which dereferences `ctx`. This is unnecessary as there is nothing to destroy. Immediately return instead. CovID: 1258255 Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/auxiliary/cso_cache/cso_context.c')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index b84d599..4a54cff 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -251,7 +251,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
{
struct cso_context *ctx = CALLOC_STRUCT(cso_context);
if (!ctx)
- goto out;
+ return NULL;
ctx->cache = cso_cache_create();
if (ctx->cache == NULL)