diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-04-30 11:42:54 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-03 21:03:22 -0400 |
commit | 1045745742fc12c1320ccce849ca2810c6563f8d (patch) | |
tree | 22e5bd974c9676c6812c54d59d50901a92c40156 /drivers/gpu/drm/amd/amdgpu | |
parent | decee87a88c05980ebc545c19d4ff252052ddc3e (diff) |
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')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 8 |
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) | |||
1274 | 1274 | ||
1275 | if (adev->pm.dpm_enabled) { | 1275 | if (adev->pm.dpm_enabled) { |
1276 | ret = cz_dpm_disable(adev); | 1276 | ret = cz_dpm_disable(adev); |
1277 | if (ret) | ||
1278 | return -EINVAL; | ||
1279 | 1277 | ||
1280 | adev->pm.dpm.current_ps = | 1278 | adev->pm.dpm.current_ps = |
1281 | adev->pm.dpm.requested_ps = | 1279 | adev->pm.dpm.requested_ps = |
@@ -1286,7 +1284,7 @@ static int cz_dpm_hw_fini(struct amdgpu_device *adev) | |||
1286 | 1284 | ||
1287 | mutex_unlock(&adev->pm.mutex); | 1285 | mutex_unlock(&adev->pm.mutex); |
1288 | 1286 | ||
1289 | return 0; | 1287 | return ret; |
1290 | } | 1288 | } |
1291 | 1289 | ||
1292 | static int cz_dpm_suspend(struct amdgpu_device *adev) | 1290 | static int cz_dpm_suspend(struct amdgpu_device *adev) |
@@ -1297,8 +1295,6 @@ static int cz_dpm_suspend(struct amdgpu_device *adev) | |||
1297 | mutex_lock(&adev->pm.mutex); | 1295 | mutex_lock(&adev->pm.mutex); |
1298 | 1296 | ||
1299 | ret = cz_dpm_disable(adev); | 1297 | ret = cz_dpm_disable(adev); |
1300 | if (ret) | ||
1301 | return -EINVAL; | ||
1302 | 1298 | ||
1303 | adev->pm.dpm.current_ps = | 1299 | adev->pm.dpm.current_ps = |
1304 | adev->pm.dpm.requested_ps = | 1300 | adev->pm.dpm.requested_ps = |
@@ -1307,7 +1303,7 @@ static int cz_dpm_suspend(struct amdgpu_device *adev) | |||
1307 | mutex_unlock(&adev->pm.mutex); | 1303 | mutex_unlock(&adev->pm.mutex); |
1308 | } | 1304 | } |
1309 | 1305 | ||
1310 | return 0; | 1306 | return ret; |
1311 | } | 1307 | } |
1312 | 1308 | ||
1313 | static int cz_dpm_resume(struct amdgpu_device *adev) | 1309 | static int cz_dpm_resume(struct amdgpu_device *adev) |