Skip to content

Commit bb2359f

Browse files
evdenisAlexei Starovoitov
authored andcommitted
bpf: Change kvfree to kfree in generic_map_lookup_batch()
buf_prevkey in generic_map_lookup_batch() is allocated with kmalloc(). It's safe to free it with kfree(). Fixes: cb4d03a ("bpf: Add generic support for lookup batch op") Signed-off-by: Denis Efremov <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 7b80581 commit bb2359f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ int generic_map_lookup_batch(struct bpf_map *map,
13991399

14001400
buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN);
14011401
if (!buf) {
1402-
kvfree(buf_prevkey);
1402+
kfree(buf_prevkey);
14031403
return -ENOMEM;
14041404
}
14051405

0 commit comments

Comments
 (0)