Skip to content

Commit bf0c2a8

Browse files
qianfengronganakryiko
authored andcommitted
bpf: Replace kvfree with kfree for kzalloc memory
The 'backedge' pointer is allocated with kzalloc(), which returns physically contiguous memory. Using kvfree() to deallocate such memory is functionally safe but semantically incorrect. Replace kvfree() with kfree() to avoid unnecessary is_vmalloc_addr() check in kvfree(). Signed-off-by: Qianfeng Rong <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent c93c59b commit bf0c2a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19553,7 +19553,7 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
1955319553
err = err ?: add_scc_backedge(env, &sl->state, backedge);
1955419554
if (err) {
1955519555
free_verifier_state(&backedge->state, false);
19556-
kvfree(backedge);
19556+
kfree(backedge);
1955719557
return err;
1955819558
}
1955919559
}

0 commit comments

Comments
 (0)