summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOfir Bitton <obitton@habana.ai>2020-11-26 12:01:11 +0100
committerOded Gabbay <ogabbay@kernel.org>2020-11-30 09:30:16 +0100
commitc8c39fbd01d42c30454e42c16bcd69c17260b90a (patch)
tree7e510888d12327842f73819b5fcd54ee7a8b2832
parentspeakup: Reject setting the speakup line discipline outside of speakup (diff)
downloadlinux-c8c39fbd01d42c30454e42c16bcd69c17260b90a.tar.xz
linux-c8c39fbd01d42c30454e42c16bcd69c17260b90a.zip
habanalabs: free host huge va_range if not used
If huge range is not valid, driver uses the host range also for huge page allocations, but driver never frees its allocation. This introduces a memory leak every time a user closes its context. Signed-off-by: Ofir Bitton <obitton@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
-rw-r--r--drivers/misc/habanalabs/common/memory.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index 84227819e4d1..bfe223abf142 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -1626,6 +1626,7 @@ static int vm_ctx_init_with_ranges(struct hl_ctx *ctx,
goto host_hpage_range_err;
}
} else {
+ kfree(ctx->host_huge_va_range);
ctx->host_huge_va_range = ctx->host_va_range;
}