From: Jiri Slaby Null sarea_priv, because next lastclose would have bad address in it if initialization is not called in the meantime. This is a problem in setups, where drm are closed after X starts. Next lastclose is invoked on X kill. Newer intel drivers (2.2) with EXA support hold the device whole time while X runs. Signed-off-by: Jiri Slaby Cc: Dave Airlie Signed-off-by: Andrew Morton --- drivers/char/drm/i915_dma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN drivers/char/drm/i915_dma.c~drm-i915-fix-oops-after-killing-x drivers/char/drm/i915_dma.c --- a/drivers/char/drm/i915_dma.c~drm-i915-fix-oops-after-killing-x +++ a/drivers/char/drm/i915_dma.c @@ -1330,6 +1330,12 @@ void i915_driver_lastclose(struct drm_de i915_mem_takedown(&(dev_priv->agp_heap)); i915_dma_cleanup(dev); + + /* Mapping won't survive to the next firstopen anyways. It will + * probably oops without it on next lastclose if we not null it + * here, if it will be mapped anywhere else, but without dma being + * initialized -js */ + dev_priv->sarea_priv = NULL; } void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) _