Skip to content

Commit 5509ac6

Browse files
Navidemalexdeucher
authored andcommitted
drm/amd/display: fix ref count leak in amdgpu_drm_ioctl
in amdgpu_drm_ioctl the call to pm_runtime_get_sync increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning. Signed-off-by: Navid Emamdoost <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9ba8923 commit 5509ac6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,11 +1383,12 @@ long amdgpu_drm_ioctl(struct file *filp,
13831383
dev = file_priv->minor->dev;
13841384
ret = pm_runtime_get_sync(dev->dev);
13851385
if (ret < 0)
1386-
return ret;
1386+
goto out;
13871387

13881388
ret = drm_ioctl(filp, cmd, arg);
13891389

13901390
pm_runtime_mark_last_busy(dev->dev);
1391+
out:
13911392
pm_runtime_put_autosuspend(dev->dev);
13921393
return ret;
13931394
}

0 commit comments

Comments
 (0)