From: Dave Airlie Date: Sat, 29 Mar 2008 21:53:58 +0000 (+1000) Subject: drm/i915: fix oops on agp=off X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=144a75fa1faa4a81530bded2e59872ef80d496b6;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git drm/i915: fix oops on agp=off From Kernel BZ 10289 - not sure why anyone would boot an intel with no agp but it shouldn't crash. Signed-off-by: Dave Airlie --- diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c index e9d6663bec73..a043bb12301a 100644 --- a/drivers/char/drm/i915_dma.c +++ b/drivers/char/drm/i915_dma.c @@ -804,6 +804,9 @@ void i915_driver_lastclose(struct drm_device * dev) { drm_i915_private_t *dev_priv = dev->dev_private; + if (!dev_priv) + return; + if (dev_priv->agp_heap) i915_mem_takedown(&(dev_priv->agp_heap));