From: Evan Quan Date: Thu, 19 Jul 2018 05:21:43 +0000 (+0800) Subject: drm/amd/powerplay: fixed uninitialized value X-Git-Tag: v4.18.8~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e327748100363bc9c36cce2b4ab357cadf2c8ee2;p=thirdparty%2Fkernel%2Fstable.git drm/amd/powerplay: fixed uninitialized value commit 1ce0688f3f6a9e9d34ae66bf779d54855def7bec upstream. The 'result' is not initialized correctly. It causes the API return an error code even on success. Signed-off-by: Evan Quan Acked-by: Huang Rui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c index c98e5de777cd1..fcd2808874bf4 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c @@ -490,7 +490,7 @@ static int vega12_get_number_dpm_level(struct pp_hwmgr *hwmgr, static int vega12_get_dpm_frequency_by_index(struct pp_hwmgr *hwmgr, PPCLK_e clkID, uint32_t index, uint32_t *clock) { - int result; + int result = 0; /* *SMU expects the Clock ID to be in the top 16 bits.