瀏覽代碼

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>
Alex Deucher 10 年之前
父節點
當前提交
1045745742
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      drivers/gpu/drm/amd/amdgpu/cz_dpm.c

+ 2 - 6
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)