mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
bpf: Replace kvfree with kfree for kzalloc memory
These pointers are allocated by kzalloc. Therefore, replace kvfree() with kfree() to avoid unnecessary is_vmalloc_addr() check in kvfree(). This is the remaining unmodified part from [1]. Signed-off-by: Feng Yang <yangfeng@kylinos.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yonghong.song@linux.dev> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20250811123949.552885-1-rongqianfeng@vivo.com [1] Link: https://lore.kernel.org/bpf/20250827032812.498216-1-yangfeng59949@163.com
This commit is contained in:
parent
6417ca8530
commit
e4980fa646
|
|
@ -2021,7 +2021,7 @@ static void free_backedges(struct bpf_scc_visit *visit)
|
|||
for (backedge = visit->backedges; backedge; backedge = next) {
|
||||
free_verifier_state(&backedge->state, false);
|
||||
next = backedge->next;
|
||||
kvfree(backedge);
|
||||
kfree(backedge);
|
||||
}
|
||||
visit->backedges = NULL;
|
||||
}
|
||||
|
|
@ -19651,7 +19651,7 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
|
|||
err = maybe_enter_scc(env, new);
|
||||
if (err) {
|
||||
free_verifier_state(new, false);
|
||||
kvfree(new_sl);
|
||||
kfree(new_sl);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user