mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-20 14:35:06 +02:00
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:
committed by
Andrii Nakryiko
parent
c93c59baa5
commit
bf0c2a84df
@@ -19553,7 +19553,7 @@ hit:
|
||||
err = err ?: add_scc_backedge(env, &sl->state, backedge);
|
||||
if (err) {
|
||||
free_verifier_state(&backedge->state, false);
|
||||
kvfree(backedge);
|
||||
kfree(backedge);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user