diff mbox series

回复: [PATCH] drm/amdgpu: fix PM reference leak in amdgpu_debugfs_gfxoff_rea()

Message ID DM4PR12MB5165A5E838057D0D49E601BB872D9@DM4PR12MB5165.namprd12.prod.outlook.com (mailing list archive)
State New, archived
Headers show
Series 回复: [PATCH] drm/amdgpu: fix PM reference leak in amdgpu_debugfs_gfxoff_rea() | expand

Commit Message

Pan, Xinhui May 17, 2021, 8:22 a.m. UTC
[AMD Official Use Only]

thanks Kuai.
But code below matches the other code block in this file.

        r = pm_runtime_get_sync(dev->dev);
        if (r < 0) {
                pm_runtime_put_autosuspend(dev->dev);
                return r;
        }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index bcaf271b39bf..eb7f9d20dad7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1058,7 +1058,7 @@  static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
        if (size & 0x3 || *pos & 0x3)
                return -EINVAL;

-       r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
+       r = pm_runtime_resume_and_get(adev_to_drm(adev)->dev);
        if (r < 0)
                return r;