summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2008-02-22 13:39:47 -0800
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2008-02-22 13:39:47 -0800
commit377e54a3dd343ee22f471072224fb185351ae448 (patch)
treea07e4c7f2be4789b64c98fe934ce6c47cd87a11c
parentc905a380fac53ebf2d990bf0546b7b883ac39548 (diff)
Don't walk into LpRing struct if it doesn't exist
Fix from Lukas Hejtmanek <xhejtman@ics.muni.cz>. If we're called early on, the ring may not be allocated yet, so we can't just read the mem field w/o checking whether LpRing exits or not.
-rw-r--r--src/i830_driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index ca6fbd75..5d533505 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1861,7 +1861,7 @@ i830_refresh_ring(ScrnInfoPtr pScrn)
/* If we're reaching RefreshRing as a result of grabbing the DRI lock
* before we've set up the ringbuffer, don't bother.
*/
- if (pI830->LpRing->mem == NULL)
+ if (!pI830->LpRing || !pI830->LpRing->mem)
return;
pI830->LpRing->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK;