[PATCH 46/88] drm/amdgpu: fix error handling in cz_dpm_hw_fini/cz_dpm_suspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Need to unlock the mutex on error.

Noticed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Reviewed-by: Christian König <christian.koenig@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 8 ++------
 1 file 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 b5c8485..e56f54b 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)
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux