Skip to content

Commit 3cfc183

Browse files
Marek Vasutmlankhorst
authored andcommitted
drm: mxsfb: Fix NULL pointer dereference crash on unload
The mxsfb->crtc.funcs may already be NULL when unloading the driver, in which case calling mxsfb_irq_disable() via drm_irq_uninstall() from mxsfb_unload() leads to NULL pointer dereference. Since all we care about is masking the IRQ and mxsfb->base is still valid, just use that to clear and mask the IRQ. Fixes: ae1ed00 ("drm: mxsfb: Stop using DRM simple display pipeline helper") Signed-off-by: Marek Vasut <[email protected]> Cc: Daniel Abrecht <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Stefan Agner <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent 519d819 commit 3cfc183

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/mxsfb/mxsfb_drv.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ static void mxsfb_irq_disable(struct drm_device *drm)
173173
struct mxsfb_drm_private *mxsfb = drm->dev_private;
174174

175175
mxsfb_enable_axi_clk(mxsfb);
176-
mxsfb->crtc.funcs->disable_vblank(&mxsfb->crtc);
176+
177+
/* Disable and clear VBLANK IRQ */
178+
writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_CLR);
179+
writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR);
180+
177181
mxsfb_disable_axi_clk(mxsfb);
178182
}
179183

0 commit comments

Comments
 (0)