Skip to contentSkip to conversation

drm/amdkfd: uninitialized variable in dbgdev_wave_control_set_registers()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 11, 2016 – Mar 14, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: uninitialized variable in dbgdev_wave_control_set_registers()

At the end of the function we expect "status" to be zero, but it's either -EINVAL or unitialized.

Fixes 788bf83db301 ('drm/amdkfd: Add wave control operation to debugger')
drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c +1 -1
index c34c393..d5e19b5 100644
@@ -513,7 +513,7 @@ static int dbgdev_wave_control_set_registers(
 				union SQ_CMD_BITS *in_reg_sq_cmd,
 				union GRBM_GFX_INDEX_BITS *in_reg_gfx_index)
 {
-	int status;
+	int status = 0;
 	union SQ_CMD_BITS reg_sq_cmd;
 	union GRBM_GFX_INDEX_BITS reg_gfx_index;
 	struct HsaDbgWaveMsgAMDGen2 *pMsg;
#1 lore raw
Quoted 11 lines · Dan Carpenter

At the end of the function we expect "status" to be zero, but it's either -EINVAL or unitialized.

Fixes 788bf83db301 ('drm/amdkfd: Add wave control operation to debugger')
drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c +0 -0
index c34c393..d5e19b5 100644

drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c static int dbgdev_wave_control_set_registers( · line 519

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c +1 -1
@@ -513,7 +513,7 @@ static int dbgdev_wave_control_set_registers(
                                union SQ_CMD_BITS *in_reg_sq_cmd,
                                union GRBM_GFX_INDEX_BITS *in_reg_gfx_index)
 {
-       int status;
+       int status = 0;
        union SQ_CMD_BITS reg_sq_cmd;
        union GRBM_GFX_INDEX_BITS reg_gfx_index;
        struct HsaDbgWaveMsgAMDGen2 *pMsg;

Thanks,
applied to my fixes tree.

Oded