Skip to content

Commit 2e07c88

Browse files
Sean Andersontomba
authored andcommitted
drm: zynqmp_kms: Unplug DRM device before removal
Prevent userspace accesses to the DRM device from causing use-after-frees by unplugging the device before we remove it. This causes any further userspace accesses to result in an error without further calls into this driver's internals. Fixes: d76271d ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem") Closes: https://lore.kernel.org/dri-devel/4d8f4c9b-2efb-4774-9a37-2f257f79b2c9@linux.dev/ Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-2-sean.anderson@linux.dev
1 parent e91191e commit 2e07c88

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/xlnx/zynqmp_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ void zynqmp_dpsub_drm_cleanup(struct zynqmp_dpsub *dpsub)
538538
{
539539
struct drm_device *drm = &dpsub->drm->dev;
540540

541-
drm_dev_unregister(drm);
541+
drm_dev_unplug(drm);
542542
drm_atomic_helper_shutdown(drm);
543543
drm_encoder_cleanup(&dpsub->drm->encoder);
544544
drm_kms_helper_poll_fini(drm);

0 commit comments

Comments
 (0)