]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/gpu/drm/i915/i915_gem_gtt.c
Merge remote-tracking branch 'drm-intel/topic/kicking-dogs-and-vgacon' into drm-intel...
[linux-beck.git] / drivers / gpu / drm / i915 / i915_gem_gtt.c
index eec820aec0224a975325a439c350e57036bd5dc9..8b3cde7033640e2450ab0b911c5cedb39172a003 100644 (file)
@@ -1992,7 +1992,10 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
 
        struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base);
 
-       drm_mm_takedown(&vm->mm);
+       if (drm_mm_initialized(&vm->mm)) {
+               drm_mm_takedown(&vm->mm);
+               list_del(&vm->global_link);
+       }
        iounmap(gtt->gsm);
        teardown_scratch_page(vm->dev);
 }
@@ -2025,6 +2028,10 @@ static int i915_gmch_probe(struct drm_device *dev,
 
 static void i915_gmch_remove(struct i915_address_space *vm)
 {
+       if (drm_mm_initialized(&vm->mm)) {
+               drm_mm_takedown(&vm->mm);
+               list_del(&vm->global_link);
+       }
        intel_gmch_remove();
 }