lkml.org 
[lkml]   [2020]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/lease: fix WARNING in idr_destroy
Date
leases has been destroyed:
drm_master_put
->drm_master_destroy
->idr_destroy

so the "out_lessee" needn't to call idr_destroy again.

Reported-and-tested-by: syzbot+05835159fe322770fe3d@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
drivers/gpu/drm/drm_lease.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index b481caf..54506c2 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -577,11 +577,14 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,

out_lessee:
drm_master_put(&lessee);
+ goto err_exit;

out_leases:
- put_unused_fd(fd);
idr_destroy(&leases);

+err_exit:
+ put_unused_fd(fd);
+
DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret);
return ret;
}
--
1.8.3.1
\
 
 \ /
  Last update: 2020-03-16 04:36    [W:0.097 / U:31.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site