Skip to content

Commit dc68540

Browse files
Hou TaoAlexei Starovoitov
authored andcommitted
bpf: Use GFP_KERNEL in bpf_event_entry_gen()
rcu_read_lock() is no longer held when invoking bpf_event_entry_gen() which is called by perf_event_fd_array_get_ptr(), so using GFP_KERNEL instead of GFP_ATOMIC to reduce the possibility of failures due to out-of-memory. Acked-by: Yonghong Song <[email protected]> Signed-off-by: Hou Tao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 8f82583 commit dc68540

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/arraymap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file,
11951195
{
11961196
struct bpf_event_entry *ee;
11971197

1198-
ee = kzalloc(sizeof(*ee), GFP_ATOMIC);
1198+
ee = kzalloc(sizeof(*ee), GFP_KERNEL);
11991199
if (ee) {
12001200
ee->event = perf_file->private_data;
12011201
ee->perf_file = perf_file;

0 commit comments

Comments
 (0)