Commit 10457457 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: fix error handling in cz_dpm_hw_fini/cz_dpm_suspend

Need to unlock the mutex on error.
Noticed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent decee87a
...@@ -1274,8 +1274,6 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev) ...@@ -1274,8 +1274,6 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev)
if (adev->pm.dpm_enabled) { if (adev->pm.dpm_enabled) {
ret = cz_dpm_disable(adev); ret = cz_dpm_disable(adev);
if (ret)
return -EINVAL;
adev->pm.dpm.current_ps = adev->pm.dpm.current_ps =
adev->pm.dpm.requested_ps = adev->pm.dpm.requested_ps =
...@@ -1286,7 +1284,7 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev) ...@@ -1286,7 +1284,7 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev)
mutex_unlock(&adev->pm.mutex); mutex_unlock(&adev->pm.mutex);
return 0; return ret;
} }
static int cz_dpm_suspend(struct amdgpu_device *adev) static int cz_dpm_suspend(struct amdgpu_device *adev)
...@@ -1297,8 +1295,6 @@ static int cz_dpm_suspend(struct amdgpu_device *adev) ...@@ -1297,8 +1295,6 @@ static int cz_dpm_suspend(struct amdgpu_device *adev)
mutex_lock(&adev->pm.mutex); mutex_lock(&adev->pm.mutex);
ret = cz_dpm_disable(adev); ret = cz_dpm_disable(adev);
if (ret)
return -EINVAL;
adev->pm.dpm.current_ps = adev->pm.dpm.current_ps =
adev->pm.dpm.requested_ps = adev->pm.dpm.requested_ps =
...@@ -1307,7 +1303,7 @@ static int cz_dpm_suspend(struct amdgpu_device *adev) ...@@ -1307,7 +1303,7 @@ static int cz_dpm_suspend(struct amdgpu_device *adev)
mutex_unlock(&adev->pm.mutex); mutex_unlock(&adev->pm.mutex);
} }
return 0; return ret;
} }
static int cz_dpm_resume(struct amdgpu_device *adev) static int cz_dpm_resume(struct amdgpu_device *adev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment