History

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().

Denis Efremov committed 6 years ago

Commit bb2359f1 parent 7b805811 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/bpf/syscall.c+1−1
@@ -1399,7 +1399,7 @@ int generic_map_lookup_batch(struct bpf_map *map, · 1398 unmodified lines
1399 1399
1400 buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN);1400 buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN);
1401 if (!buf) {1401 if (!buf) {
1402 kvfree(buf_prevkey);1402 kfree(buf_prevkey);
1403 return -ENOMEM;1403 return -ENOMEM;
1404 }1404 }
1405 1405

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t