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:
Qianfeng Rong
2025-08-11 20:39:49 +08:00
committed by Andrii Nakryiko
parent c93c59baa5
commit bf0c2a84df
+1 -1
View File
@@ -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;
}
}