summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs
diff options
context:
space:
mode:
authorDafna Hirschfeld <dhirschfeld@habana.ai>2022-08-15 10:40:55 +0200
committerOded Gabbay <ogabbay@kernel.org>2022-09-18 12:29:52 +0200
commit46e49f434fcaafe3c62232aaa0358f03b462141d (patch)
tree3e85739cdf33693d1ece2b33e241a30a50656934 /drivers/misc/habanalabs
parenthabanalabs: select FW_LOADER in Kconfig (diff)
downloadlinux-46e49f434fcaafe3c62232aaa0358f03b462141d.tar.xz
linux-46e49f434fcaafe3c62232aaa0358f03b462141d.zip
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 <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs')
-rw-r--r--drivers/misc/habanalabs/common/mmu/mmu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/mmu/mmu.c b/drivers/misc/habanalabs/common/mmu/mmu.c
index 60740de47b34..4153aec55594 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;
}
}