drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()
Subsystems (3)
PATCH 1/1 drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()
The "shadow" variable was never set to false.
There is a quirk in current versions of GCC where it will sometimes set it to false and not warn about the uninitiliazed variable. That means that this bug wouldn't have been discovered in normal testing.
Fixes 2e0cc4d48b91 ("drm/amdgpu: revise RLCG access path")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
@@ -735,7 +735,7 @@ void gfx_v9_0_rlcg_wreg(struct amdgpu_device *adev, u32 offset, u32 v)static void *spare_int;static uint32_t grbm_cntl;static uint32_t grbm_idx; -bool shadow; +bool shadow = false; scratch_reg0 = adev->rmmio + (adev->reg_offset[GC_HWIP ][0 ][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0)*4 ; scratch_reg1 = adev->rmmio + (adev->reg_offset[GC_HWIP ][0 ][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG1)*4 ;
Signature · 1 line
2.25.1