Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Denis Efremov and committed by
Alexei Starovoitov
bb2359f4 7b805819

+1 -1
+1 -1
kernel/bpf/syscall.c
··· 1399 1399 1400 1400 buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN); 1401 1401 if (!buf) { 1402 - kvfree(buf_prevkey); 1402 + kfree(buf_prevkey); 1403 1403 return -ENOMEM; 1404 1404 } 1405 1405