summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-08-21 12:52:57 +0000
committerkib <kib@FreeBSD.org>2007-08-21 12:52:57 +0000
commit8f2695325e8796fd73ee177b7464d3d19960b45f (patch)
tree59be11dd528e23b5c3504daa8eeeff85f5590b85
parentcbe3361efb4504ce92269266617dfcd1dc27abba (diff)
downloadFreeBSD-src-8f2695325e8796fd73ee177b7464d3d19960b45f.zip
FreeBSD-src-8f2695325e8796fd73ee177b7464d3d19960b45f.tar.gz
Properly initialize the dev_priv before calling the i915_dma_cleanup().
This fixes my rev. 1.5. Reviewed by: anholt Approved by: re (kensmith) MFC after: 2 weeks
-rw-r--r--sys/dev/drm/i915_dma.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/drm/i915_dma.c b/sys/dev/drm/i915_dma.c
index 3e72769..9fe278a 100644
--- a/sys/dev/drm/i915_dma.c
+++ b/sys/dev/drm/i915_dma.c
@@ -125,18 +125,17 @@ static int i915_initialize(drm_device_t * dev,
drm_dma_handle_t *dmah;
DRM_UNLOCK();
+ memset(dev_priv, 0, sizeof(drm_i915_private_t));
dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE,
0xffffffff);
+ DRM_LOCK();
if (!dmah) {
dev->dev_private = (void *)dev_priv;
i915_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n");
- DRM_LOCK();
return DRM_ERR(ENOMEM);
}
- DRM_LOCK();
- memset(dev_priv, 0, sizeof(drm_i915_private_t));
dev_priv->status_page_dmah = dmah;
DRM_GETSAREA();
OpenPOWER on IntegriCloud