Commit c8c39fbd authored by Ofir Bitton's avatar Ofir Bitton Committed by Oded Gabbay
Browse files

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: default avatarOfir Bitton <obitton@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent f0992098
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}