gallium/cso: avoid unnecessary null dereference
authorEric Engestrom <eric@engestrom.ch>
Tue, 12 Jul 2016 21:48:28 +0000 (22:48 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 24 Aug 2016 10:35:05 +0000 (11:35 +0100)
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>
src/gallium/auxiliary/cso_cache/cso_context.c

index b84d5997aaa893a127d9723499d4091790d1246c..4a54cff97a11b90f50ccf1d73750ff86ac7c4d5b 100644 (file)
@@ -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)