habanalabs: free host huge va_range if not used
PATCH 1/1 habanalabs: free host huge va_range if not used
From: Ofir Bitton <[email protected]>
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 <[email protected]>
Reviewed-by Oded Gabbay <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/common/memory.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/common/memory.c +1 -0
@@ -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; }
Signature · 1 line
2.17.1