summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_kms.c
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2020-06-14 05:21:22 +0300
committerAlex Deucher <alexander.deucher@amd.com>2020-07-01 08:59:22 +0300
commit9fb10671011143d15b6b40d6d5fa9c52c57e9d63 (patch)
tree9d95ded0889b96230f33f8e9ff14c004333c4f2d /drivers/gpu/drm/radeon/radeon_kms.c
parentf79f94765f8c39db0b7dec1d335ab046aac03f20 (diff)
downloadlinux-9fb10671011143d15b6b40d6d5fa9c52c57e9d63.tar.xz
drm/radeon: Fix reference count leaks caused by pm_runtime_get_sync
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Acked-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 95006cbf42c3..c76955228731 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -638,8 +638,10 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
file_priv->driver_priv = NULL;
r = pm_runtime_get_sync(dev->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(dev->dev);
return r;
+ }
/* new gpu have virtual address space support */
if (rdev->family >= CHIP_CAYMAN) {