diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2011-05-01 15:12:45 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2011-05-01 15:12:45 +0000 |
commit | f82aa81e84c45c4f8078686eb977ce4ca9d6ed3d (patch) | |
tree | 353a265027e14f6e11fc41f78d4185bbb445f676 | |
parent | 4ee82707bcc1a7d5d2166cb1480b523c8c655421 (diff) |
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.c | 4 |
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(); |