From cddb85dc1eca10300eb23873f6d9e84267aabd9d Mon Sep 17 00:00:00 2001 From: Matthew Auld Date: Wed, 6 Nov 2019 12:31:35 +0000 Subject: [PATCH] drm/i915/lmem: fixup fake lmem teardown We should not be unconditionally calling release_fake_lmem_bar. Signed-off-by: Matthew Auld Cc: Lucas De Marchi Cc: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20191106123135.12441-1-matthew.auld@intel.com --- drivers/gpu/drm/i915/intel_region_lmem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_region_lmem.c b/drivers/gpu/drm/i915/intel_region_lmem.c index 5831180956358..eddb392917aa5 100644 --- a/drivers/gpu/drm/i915/intel_region_lmem.c +++ b/drivers/gpu/drm/i915/intel_region_lmem.c @@ -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, -- 2.39.5