drm/amdgpu: fix locking in force performance level
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 19 Feb 2016 20:18:45 +0000 (15:18 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Feb 2016 16:30:50 +0000 (11:30 -0500)
Looks like a copy paste typo when we added powerplay
support.

Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index 7d8d84eaea4a5ab258eb5dac4a383f6aff81850d..5ed5598997e9ae0a507d83f1ebfef3df7117e8da 100644 (file)
@@ -157,6 +157,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
                mutex_lock(&adev->pm.mutex);
                if (adev->pm.dpm.thermal_active) {
                        count = -EINVAL;
+                       mutex_unlock(&adev->pm.mutex);
                        goto fail;
                }
                ret = amdgpu_dpm_force_performance_level(adev, level);
@@ -167,8 +168,6 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
                mutex_unlock(&adev->pm.mutex);
        }
 fail:
-       mutex_unlock(&adev->pm.mutex);
-
        return count;
 }