[PATCH 1/2] drm: do lower level device put on unplugged releases

Dave Airlie airlied at gmail.com
Fri Mar 15 05:13:29 UTC 2019


From: Dave Airlie <airlied at redhat.com>

When we release the file handle on a device that has been unplugged
it has already called the unregister path, which doesn't like being
called again. We should just do the dev put version instead.

This fixes some crashes unplugged in a udl device.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 drivers/gpu/drm/drm_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 83a5bbca6e7e..900fe8228745 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -492,7 +492,7 @@ int drm_release(struct inode *inode, struct file *filp)
 	if (!--dev->open_count) {
 		drm_lastclose(dev);
 		if (drm_dev_is_unplugged(dev))
-			drm_put_dev(dev);
+			drm_dev_put(dev);
 	}
 	mutex_unlock(&drm_global_mutex);
 
-- 
2.20.1



More information about the dri-devel mailing list