dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()
@ 2020-03-20 13:24 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-03-20 13:24 UTC (permalink / raw)
  To: Alex Deucher, Monk Liu
  Cc: Emily Deng, David Airlie, Marek Olšák, Tao Zhou,
	kernel-janitors, amd-gfx, Le Ma, Huang Rui, dri-devel,
	Zhou pengju, James Zhu, Christian König, Dennis Li,
	Hawking Zhang

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 <dan.carpenter@oracle.com>
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7bc2486167e7..affbff76758c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -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;

dri-devel mailing list

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-20 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 13:24 [PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).