aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-04-30 11:42:54 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-06-03 21:03:22 -0400
commit1045745742fc12c1320ccce849ca2810c6563f8d (patch)
tree22e5bd974c9676c6812c54d59d50901a92c40156 /drivers/gpu/drm/amd/amdgpu/cz_dpm.c
parentdrm/amdgpu: let bo_list handler start from 1 (diff)
downloadlinux-dev-1045745742fc12c1320ccce849ca2810c6563f8d.tar.xz
linux-dev-1045745742fc12c1320ccce849ca2810c6563f8d.zip
drm/amdgpu: fix error handling in cz_dpm_hw_fini/cz_dpm_suspend
Need to unlock the mutex on error. Noticed-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/cz_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/cz_dpm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
index b5c8485d8a58..e56f54bf87d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
@@ -1274,8 +1274,6 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev)
if (adev->pm.dpm_enabled) {
ret = cz_dpm_disable(adev);
- if (ret)
- return -EINVAL;
adev->pm.dpm.current_ps =
adev->pm.dpm.requested_ps =
@@ -1286,7 +1284,7 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev)
mutex_unlock(&adev->pm.mutex);
- return 0;
+ return ret;
}
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);
ret = cz_dpm_disable(adev);
- if (ret)
- return -EINVAL;
adev->pm.dpm.current_ps =
adev->pm.dpm.requested_ps =
@@ -1307,7 +1303,7 @@ static int cz_dpm_suspend(struct amdgpu_device *adev)
mutex_unlock(&adev->pm.mutex);
}
- return 0;
+ return ret;
}
static int cz_dpm_resume(struct amdgpu_device *adev)