From: Eric Engestrom Date: Tue, 12 Jul 2016 21:48:28 +0000 (+0100) Subject: gallium/cso: avoid unnecessary null dereference X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9411eb67ecebfc76c909ca81b09e6e7fe08ac8eb;p=mesa.git 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 Reviewed-by: Nicolai Hähnle Reviewed-by: Marek Olšák --- diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index b84d5997aaa..4a54cff97a1 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)