From b0817a42e789a83454e6acba0578116829e2bf51 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 24 Mar 2008 18:52:26 +1000 Subject: [PATCH] i915: fix oops on agp=off Kernel bug 10289. --- shared-core/i915_dma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 407befcc..1e493e38 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -1060,6 +1060,10 @@ void i915_driver_lastclose(struct drm_device * dev) { drm_i915_private_t *dev_priv = dev->dev_private; + /* agp off can use this to get called before dev_priv */ + if (!dev_priv) + return; + #ifdef I915_HAVE_BUFFER if (dev_priv->val_bufs) { vfree(dev_priv->val_bufs);