LKML Archive on
help / color / mirror / Atom feed
* [PATCH][next] drm/amd/pp: fix logical or'ing of garbage in result by initializing result to zero
@ 2018-03-26 14:13 Colin King
  0 siblings, 0 replies; only message in thread
From: Colin King @ 2018-03-26 14:13 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Zhou, David Airlie,
	Rex Zhu, Evan Quan, Tom St Denis, Huang Rui, amd-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <>

Currently result is not initialized, so it contains a garbage value and
this is or'd with data from vega10_program_didt_config_registers() which
can end up with a non-zero value when the result should be zero.  Fix
this by ensuring result is initialized to zero.

Detected by CoverityScan, CID#1466088 ("Uninitialized scalar variable")

Fixes: 9b7b8154cdb8 ("drm/amd/powerplay: added didt support for vega10")
Signed-off-by: Colin Ian King <>
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
index b1f74c7f0943..49822ea3ddd5 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c
@@ -1091,7 +1091,7 @@ static int vega10_disable_se_edc_config(struct pp_hwmgr *hwmgr)
 static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)
-	int result;
+	int result = 0;
 	uint32_t num_se = 0;
 	uint32_t count, data;
 	struct amdgpu_device *adev = hwmgr->adev;

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

only message in thread, other threads:[~2018-03-26 14:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-26 14:13 [PATCH][next] drm/amd/pp: fix logical or'ing of garbage in result by initializing result to zero Colin King

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).