summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/udl/udl_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-04-05 06:17:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-17 09:38:50 +0300
commit93d60348edcbaa3ea039ba1a5913914077c175ab (patch)
tree5ba29ccd151547aa0347f304619daa282968a34f /drivers/gpu/drm/udl/udl_drv.c
parentdf4106f23d0b2eecd13fb89784f7cbba070d2b1c (diff)
downloadlinux-93d60348edcbaa3ea039ba1a5913914077c175ab.tar.xz
drm/udl: add a release method and delay modeset teardown
commit 9b39b013037fbfa8d4b999345d9e904d8a336fc2 upstream. If we unplug a udl device, the usb callback with deinit the mode_config struct, however userspace will still have an open file descriptor and a framebuffer on that device. When userspace closes the fd, we'll oops because it'll try and look stuff up in the object idr which we've destroyed. This punts destroying the mode objects until release time instead. Cc: stable@vger.kernel.org Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190405031715.5959-2-airlied@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/udl/udl_drv.c')
-rw-r--r--drivers/gpu/drm/udl/udl_drv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 9ef515df724b..54e767bd5ddb 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -51,6 +51,7 @@ static struct drm_driver driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME,
.load = udl_driver_load,
.unload = udl_driver_unload,
+ .release = udl_driver_release,
/* gem hooks */
.gem_free_object_unlocked = udl_gem_free_object,