zink: error-check right variable
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 27 Nov 2019 16:44:05 +0000 (17:44 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 29 Nov 2019 08:54:25 +0000 (09:54 +0100)
That's not the value we just allocated...

CoverityID: 1455177
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c

index 99b9e5833bc5bb0cccba275397237ea05ef0f852..32d5283c2172c94e96f6ad8282fbffb29ac54e33 100644 (file)
@@ -840,7 +840,7 @@ get_const_def(struct spirv_builder *b, SpvOp op, SpvId type,
    }
 
    struct spirv_const *cnst = CALLOC_STRUCT(spirv_const);
-   if (!type)
+   if (!cnst)
       return 0;
 
    cnst->op = op;