Skip to content

Commit

Permalink
drm/omap: fix crash on module unload
Browse files Browse the repository at this point in the history
When unloading omapdrm we get a NULL pointer deref in
omap_drm_irq_uninstall(). This is caused by:

967dd48 ("drm: remove
drm_vblank_no_hw_counter assignment from driver code")

We shut down all the crtcs at unload time before calling
omap_drm_irq_uninstall, so the code in omap_drm_irq_uninstall() is
unnecessary and can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  • Loading branch information
Tomi Valkeinen committed Apr 3, 2017
1 parent 8a54aa9 commit c9af3ed
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions drivers/gpu/drm/omapdrm/omap_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,25 +285,11 @@ int omap_drm_irq_install(struct drm_device *dev)
void omap_drm_irq_uninstall(struct drm_device *dev)
{
struct omap_drm_private *priv = dev->dev_private;
unsigned long irqflags;
int i;

if (!dev->irq_enabled)
return;

dev->irq_enabled = false;

/* Wake up any waiters so they don't hang. */
if (dev->num_crtcs) {
spin_lock_irqsave(&dev->vbl_lock, irqflags);
for (i = 0; i < dev->num_crtcs; i++) {
wake_up(&dev->vblank[i].queue);
dev->vblank[i].enabled = false;
dev->vblank[i].last =
dev->driver->get_vblank_counter(dev, i);
}
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
}

priv->dispc_ops->free_irq(dev);
}

0 comments on commit c9af3ed

Please sign in to comment.