mirror of https://github.com/torvalds/linux.git
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 <rongqianfeng@vivo.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/bpf/20250811123949.552885-1-rongqianfeng@vivo.com
This commit is contained in:
parent
c93c59baa5
commit
bf0c2a84df
|
|
@ -19553,7 +19553,7 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
|
|||
err = err ?: add_scc_backedge(env, &sl->state, backedge);
|
||||
if (err) {
|
||||
free_verifier_state(&backedge->state, false);
|
||||
kvfree(backedge);
|
||||
kfree(backedge);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue