zink: Remove duplicate variable zm.
authorVinson Lee <vlee@freedesktop.org>
Sat, 15 Oct 2022 06:04:28 +0000 (23:04 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Oct 2022 17:44:09 +0000 (17:44 +0000)
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In
zm = zm = create_shader_module_for_stage_optimal(ctx, screen, prog->shaders[i], prog, i, state),
zm is written twice with the same value.

Fixes: 325c703624a ("zink: add 'optimal_keys' handling for shader keys")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19086>

src/gallium/drivers/zink/zink_program.c

index 776092a..6102ee4 100644 (file)
@@ -441,7 +441,7 @@ generate_gfx_program_modules_optimal(struct zink_context *ctx, struct zink_scree
 
       assert(prog->shaders[i]);
 
-      struct zink_shader_module *zm = zm = create_shader_module_for_stage_optimal(ctx, screen, prog->shaders[i], prog, i, state);
+      struct zink_shader_module *zm = create_shader_module_for_stage_optimal(ctx, screen, prog->shaders[i], prog, i, state);
       prog->modules[i] = zm->shader;
    }