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

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
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment