summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroga <oga@openbsd.org>2011-05-01 15:12:44 +0000
committeroga <oga@openbsd.org>2011-05-01 15:12:44 +0000
commit6bfb4af1baf2daa2cd1f2dbf3d773dec60e85b25 (patch)
tree68ae8f558e60f2bfd14e71729cb3001eeffa14c3
parentSplit ALL, ROLE and TYPE into their own actions. Since you can (diff)
downloadwireguard-openbsd-6bfb4af1baf2daa2cd1f2dbf3d773dec60e85b25.tar.xz
wireguard-openbsd-6bfb4af1baf2daa2cd1f2dbf3d773dec60e85b25.zip
Fix a NULL dereference if drm fails to attach.
There's probably something better to be done, but we should at least boot if this happens now.
-rw-r--r--sys/dev/pci/drm/i915_drv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 8eb0cdf200f..6fb20fed36a 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -3922,6 +3922,10 @@ i915_gem_idle(struct inteldrm_softc *dev_priv)
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
int ret;
+ /* If drm attach failed */
+ if (dev == NULL)
+ return (0);
+
DRM_LOCK();
if (dev_priv->mm.suspended || dev_priv->ring.ring_obj == NULL) {
DRM_UNLOCK();