summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2019-04-25 09:33:47 +0000
committerkettenis <kettenis@openbsd.org>2019-04-25 09:33:47 +0000
commita5a8a956443b57ab8a49a50d08f95ef4732b752d (patch)
tree604e0c3e8b781147e759ba3da7dd374b2d3f2d2a
parentAutomatically scroll if dragging to create a selection with the mouse (diff)
downloadwireguard-openbsd-a5a8a956443b57ab8a49a50d08f95ef4732b752d.tar.xz
wireguard-openbsd-a5a8a956443b57ab8a49a50d08f95ef4732b752d.zip
Since we now have an attachhook, the actual interrupt handler is installed
late, after we enable interrupts. If the interrupt pin used for inteldrm(4) is shared with another device, we may end up being called before the actual interrup handler is installed resulting in a null-pointer dereference. Fix this by adding an explicit check that the interrupt handler function pointer has been set. ok matthieu@, jsg@
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c
index 137f9a077a5..67f9b15ba09 100644
--- a/sys/dev/pci/drm/i915/i915_drv.c
+++ b/sys/dev/pci/drm/i915/i915_drv.c
@@ -3775,7 +3775,10 @@ inteldrm_intr(void *arg)
struct inteldrm_softc *dev_priv = arg;
struct drm_device *dev = &dev_priv->drm;
- return dev->driver->irq_handler(0, dev);
+ if (dev->driver->irq_handler)
+ return dev->driver->irq_handler(0, dev);
+
+ return 0;
}
#endif