]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/powerplay: fixed uninitialized value
authorEvan Quan <evan.quan@amd.com>
Thu, 19 Jul 2018 05:21:43 +0000 (13:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:58 +0000 (09:46 +0200)
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 <evan.quan@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

index c98e5de777cd1bc18abbc4a5560430543f23ddd6..fcd2808874bf40ebec257a962f77f6c8e8127734 100644 (file)
@@ -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.