drm/amdgpu: Fix double runtime PM put in amdgpu_debugfs_gpr_read()
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix double runtime PM put in amdgpu_debugfs_gpr_read()
From: Lu Yao <[email protected]>
If put_user() failed in loop, jumping to err label will cause putting the reference a second time.
Fixes 9eee152aab56 ("drm/amdgpu/debugfs: fix ref count leak when pm_runtime_get_sync fails")
Signed-off-by Lu Yao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2 -1
@@ -1302,8 +1302,9 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf, value = data[result >>2 ]; r =put_user (value, (uint32_t *)buf);if (r) { +kfree (data);amdgpu_virt_disable_access_debugfs (adev); - goto err; +return r; } result +=4 ;
Signature · 1 line
2.25.1