Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Navid Emamdoost and committed by
Alex Deucher
5509ac65 9ba8923c

+2 -1
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 1383 1383 dev = file_priv->minor->dev; 1384 1384 ret = pm_runtime_get_sync(dev->dev); 1385 1385 if (ret < 0) 1386 - return ret; 1386 + goto out; 1387 1387 1388 1388 ret = drm_ioctl(filp, cmd, arg); 1389 1389 1390 1390 pm_runtime_mark_last_busy(dev->dev); 1391 + out: 1391 1392 pm_runtime_put_autosuspend(dev->dev); 1392 1393 return ret; 1393 1394 }