linux/drivers/gpu/drm/udl
Emil Lundmark fcb74da1eb drm: udl: Destroy framebuffer only if it was initialized
This fixes a NULL pointer dereference that can happen if the UDL
driver is unloaded before the framebuffer is initialized. This can
happen e.g. if the USB device is unplugged right after it was plugged
in.

As explained by Stéphane Marchesin:

It happens when fbdev is disabled (which is the case for Chrome OS).
Even though intialization of the fbdev part is optional (it's done in
udlfb_create which is the callback for fb_probe()), the teardown isn't
optional (udl_driver_unload -> udl_fbdev_cleanup ->
udl_fbdev_destroy).

Note that udl_fbdev_cleanup *tries* to be conditional (you can see it
does if (!udl->fbdev)) but that doesn't work, because udl->fbdev is
always set during udl_fbdev_init.

Cc: stable@vger.kernel.org
Suggested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Emil Lundmark <lndmrk@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180528142711.142466-1-lndmrk@chromium.org
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2018-09-10 16:02:51 -04:00
..
Kconfig drm/udl: make fbdev support really optional 2016-07-18 09:11:40 +02:00
Makefile drm/udl: remove unneeded -Iinclude/drm compiler flag 2017-05-18 07:13:53 +02:00
udl_connector.c drm: drop _mode_ from drm_mode_connector_attach_encoder 2018-07-13 18:40:27 +02:00
udl_connector.h drm/udl: Fixed problem with UDL adpater reconnection 2017-10-16 15:36:02 -04:00
udl_dmabuf.c dma-buf: remove kmap_atomic interface 2018-06-20 15:59:34 +02:00
udl_drv.c drm/udl: Get rid of dev->struct_mutex usage 2018-03-28 17:07:36 +02:00
udl_drv.h Merge branch 'drm-udl-next' of git://people.freedesktop.org/~airlied/linux into drm-next 2018-07-31 08:24:33 +10:00
udl_encoder.c drm/udl: removed optional dummy encoder mode_fixup function. 2016-02-16 15:30:12 +01:00
udl_fb.c drm: udl: Destroy framebuffer only if it was initialized 2018-09-10 16:02:51 -04:00
udl_gem.c gpu: drm: udl: Adding new typedef vm_fault_t 2018-05-23 10:48:46 +02:00
udl_main.c udl-kms: use spin_lock_irq instead of spin_lock_irqsave 2018-07-31 08:11:12 +10:00
udl_modeset.c udl-kms: dont spam the syslog with debug messages 2018-07-31 08:11:12 +10:00
udl_transfer.c udl-kms: avoid prefetch 2018-07-31 08:11:12 +10:00