drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check
authorErnst Sjöstrand <ernstp@gmail.com>
Mon, 24 Jun 2019 15:15:40 +0000 (17:15 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jun 2019 18:23:34 +0000 (13:23 -0500)
Reported by smatch:
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:693 amdgpu_set_pp_od_clk_voltage() error: uninitialized symbol 'ret'.

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index 495613c3b126c34d93ae8c838782ea338ec207bb..302307c00f83d00f891c604a8fb36513b4115648 100644 (file)
@@ -689,12 +689,12 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
                if (ret)
                        return -EINVAL;
        } else {
-               if (adev->powerplay.pp_funcs->odn_edit_dpm_table)
+               if (adev->powerplay.pp_funcs->odn_edit_dpm_table) {
                        ret = amdgpu_dpm_odn_edit_dpm_table(adev, type,
                                                parameter, parameter_size);
-
-               if (ret)
-                       return -EINVAL;
+                       if (ret)
+                               return -EINVAL;
+               }
 
                if (type == PP_OD_COMMIT_DPM_TABLE) {
                        if (adev->powerplay.pp_funcs->dispatch_tasks) {