From: Erik Faye-Lund Date: Wed, 27 Nov 2019 16:44:05 +0000 (+0100) Subject: zink: error-check right variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a63124a06b4737199301956513b7627bcaf24ac;p=mesa.git zink: error-check right variable That's not the value we just allocated... CoverityID: 1455177 Reviewed-by: Dave Airlie --- 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;