drm/amd/powerplay: fixed uninitialized value
authorEvan Quan <evan.quan@amd.com>
Thu, 19 Jul 2018 05:21:43 +0000 (13:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Jul 2018 18:56:43 +0000 (13:56 -0500)
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
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c

index 912d0d6cf476542f24857039ebdac4874e0cfceb..4ed218dd8ba7a113766e91bf87497fd69638ac3e 100644 (file)
@@ -488,7 +488,7 @@ static int vega12_get_number_of_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.