dzn: Fix unitialized var access in dzn_meta_compile_shader()

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16221>
This commit is contained in:
Boris Brezillon 2022-06-07 07:20:23 -07:00 committed by Marge Bot
parent df63772f76
commit 4f1cb63bf3
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ dzn_meta_compile_shader(struct dzn_device *device, nir_shader *nir,
bool ret = nir_to_dxil(nir, &opts, &dxil_blob); bool ret = nir_to_dxil(nir, &opts, &dxil_blob);
assert(ret); assert(ret);
char *err; char *err = NULL;
bool res = dxil_validate_module(instance->dxil_validator, bool res = dxil_validate_module(instance->dxil_validator,
dxil_blob.data, dxil_blob.data,
dxil_blob.size, &err); dxil_blob.size, &err);
@ -70,12 +70,12 @@ dzn_meta_compile_shader(struct dzn_device *device, nir_shader *nir,
if ((instance->debug_flags & DZN_DEBUG_DXIL) && if ((instance->debug_flags & DZN_DEBUG_DXIL) &&
(instance->debug_flags & DZN_DEBUG_INTERNAL) && (instance->debug_flags & DZN_DEBUG_INTERNAL) &&
err) { !res) {
fprintf(stderr, fprintf(stderr,
"== VALIDATION ERROR =============================================\n" "== VALIDATION ERROR =============================================\n"
"%s\n" "%s\n"
"== END ==========================================================\n", "== END ==========================================================\n",
err); err ? err : "unknown");
ralloc_free(err); ralloc_free(err);
} }
assert(res); assert(res);