summaryrefslogtreecommitdiffstats
path: root/kernel/bpf
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2020-06-01 18:28:14 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-06-01 23:48:33 +0200
commitbb2359f4dbe98e8863b4e885fc09269ef4682ec3 (patch)
tree0a444c6c75337492ed4b11c448e283af7856f026 /kernel/bpf
parentMerge branch 'fix-ktls-with-sk_skb_verdict' (diff)
downloadlinux-bb2359f4dbe98e8863b4e885fc09269ef4682ec3.tar.xz
linux-bb2359f4dbe98e8863b4e885fc09269ef4682ec3.zip
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: cb4d03ab499d ("bpf: Add generic support for lookup batch op") Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20200601162814.17426-1-efremov@linux.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf')
-rw-r--r--kernel/bpf/syscall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 9de3540fa90c..e83b0818b529 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1399,7 +1399,7 @@ int generic_map_lookup_batch(struct bpf_map *map,
buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN);
if (!buf) {
- kvfree(buf_prevkey);
+ kfree(buf_prevkey);
return -ENOMEM;
}