summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYongzhi Liu <lyz_cs@pku.edu.cn>2022-01-18 15:11:51 -0500
committerAlex Deucher <alexander.deucher@amd.com>2022-01-18 17:43:36 -0500
commit4bd8dd0d61f961e6c13cc118d4ebbdba57f8561f (patch)
tree026ef0e2b6fe0d0c302082bccdc5a333b75d4d7c
parent552b7cb0eed12c184b3bdfcc262e96a954a2bc86 (diff)
downloadlinux-4bd8dd0d61f961e6c13cc118d4ebbdba57f8561f.tar.gz
linux-4bd8dd0d61f961e6c13cc118d4ebbdba57f8561f.tar.bz2
linux-4bd8dd0d61f961e6c13cc118d4ebbdba57f8561f.zip
drm/amdgpu: Add missing pm_runtime_put_autosuspend
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, thus a matching decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 9aea1cc5b27e..4b950de9bf66 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1120,8 +1120,10 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
return -EINVAL;
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
return r;
+ }
while (size) {
uint32_t value;