Skip to content

Commit c8c39fb

Browse files
ofirbittogabbay
authored andcommitted
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 <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
1 parent f099209 commit c8c39fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/misc/habanalabs/common/memory.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,7 @@ static int vm_ctx_init_with_ranges(struct hl_ctx *ctx,
16261626
goto host_hpage_range_err;
16271627
}
16281628
} else {
1629+
kfree(ctx->host_huge_va_range);
16291630
ctx->host_huge_va_range = ctx->host_va_range;
16301631
}
16311632

0 commit comments

Comments
 (0)