]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/lmem: fixup fake lmem teardown
authorMatthew Auld <matthew.auld@intel.com>
Wed, 6 Nov 2019 12:31:35 +0000 (12:31 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 6 Nov 2019 14:34:10 +0000 (14:34 +0000)
We should not be unconditionally calling release_fake_lmem_bar.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191106123135.12441-1-matthew.auld@intel.com
drivers/gpu/drm/i915/intel_region_lmem.c

index 58311809563580b1475e583e53fd99a09c710320..eddb392917aa50a12a83f38979d2ec841b264d22 100644 (file)
@@ -51,8 +51,10 @@ static int init_fake_lmem_bar(struct intel_memory_region *mem)
 
 static void release_fake_lmem_bar(struct intel_memory_region *mem)
 {
-       if (drm_mm_node_allocated(&mem->fake_mappable))
-               drm_mm_remove_node(&mem->fake_mappable);
+       if (!drm_mm_node_allocated(&mem->fake_mappable))
+               return;
+
+       drm_mm_remove_node(&mem->fake_mappable);
 
        dma_unmap_resource(&mem->i915->drm.pdev->dev,
                           mem->remap_addr,