From 7a63124a06b4737199301956513b7627bcaf24ac Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 27 Nov 2019 17:44:05 +0100 Subject: zink: error-check right variable That's not the value we just allocated... CoverityID: 1455177 Reviewed-by: Dave Airlie --- src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c b/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c index 99b9e5833bc..32d5283c217 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c +++ b/src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c @@ -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; -- cgit v1.2.3