From: Dafna Hirschfeld Date: Mon, 15 Aug 2022 08:40:55 +0000 (+0300) Subject: habanalabs: if map page fails don't try to unmap it X-Git-Tag: v6.1-rc5~262^2~57^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46e49f434fcaafe3c62232aaa0358f03b462141d;p=platform%2Fkernel%2Flinux-starfive.git habanalabs: if map page fails don't try to unmap it The original code tried to unmap a page that was not mapped as part of the map page error path. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/common/mmu/mmu.c b/drivers/misc/habanalabs/common/mmu/mmu.c index 60740de..4153aec 100644 --- a/drivers/misc/habanalabs/common/mmu/mmu.c +++ b/drivers/misc/habanalabs/common/mmu/mmu.c @@ -403,6 +403,8 @@ int hl_mmu_map_contiguous(struct hl_ctx *ctx, u64 virt_addr, dev_err(hdev->dev, "Map failed for va 0x%llx to pa 0x%llx\n", curr_va, curr_pa); + /* last mapping failed so don't try to unmap it - reduce off by page_size */ + off -= page_size; goto unmap; } }