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>
if (adev->pm.dpm_enabled) {
ret = cz_dpm_disable(adev);
- if (ret)
- return -EINVAL;
adev->pm.dpm.current_ps =
adev->pm.dpm.requested_ps =
mutex_unlock(&adev->pm.mutex);
- return 0;
+ return ret;
}
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 =
mutex_unlock(&adev->pm.mutex);
}
- return 0;
+ return ret;
}
static int cz_dpm_resume(struct amdgpu_device *adev)