diff options
author | Aditya Pakki <pakki001@umn.edu> | 2020-06-14 03:41:56 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 10:50:49 +0200 |
commit | 659fb5f154c3434c90a34586f3b7aa1c39cf6062 (patch) | |
tree | e8e078c29a4c08f5a0f3f7b543a78f4d3d3b53ba /drivers/gpu/drm/nouveau/nouveau_gem.c | |
parent | drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open (diff) | |
download | linux-659fb5f154c3434c90a34586f3b7aa1c39cf6062.tar.xz linux-659fb5f154c3434c90a34586f3b7aa1c39cf6062.zip |
drm/nouveau: fix multiple instances of reference count leaks
On calling pm_runtime_get_sync() the reference count of the device
is incremented. In case of failure, decrement the
ref count before returning the error.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_gem.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 63b832585390..133ab6fb7798 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -45,8 +45,10 @@ nouveau_gem_object_del(struct drm_gem_object *gem) int ret; ret = pm_runtime_get_sync(dev); - if (WARN_ON(ret < 0 && ret != -EACCES)) + if (WARN_ON(ret < 0 && ret != -EACCES)) { + pm_runtime_put_autosuspend(dev); return; + } if (gem->import_attach) drm_prime_gem_destroy(gem, nvbo->bo.sg); |