diff options
Diffstat (limited to 'kernel/bpf/stackmap.c')
-rw-r--r-- | kernel/bpf/stackmap.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index b59ace0f0f09..b675a3f3d141 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/stackmap.c | |||
@@ -285,11 +285,10 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs, | |||
285 | { | 285 | { |
286 | int i; | 286 | int i; |
287 | struct vm_area_struct *vma; | 287 | struct vm_area_struct *vma; |
288 | bool in_nmi_ctx = in_nmi(); | ||
289 | bool irq_work_busy = false; | 288 | bool irq_work_busy = false; |
290 | struct stack_map_irq_work *work; | 289 | struct stack_map_irq_work *work = NULL; |
291 | 290 | ||
292 | if (in_nmi_ctx) { | 291 | if (in_nmi()) { |
293 | work = this_cpu_ptr(&up_read_work); | 292 | work = this_cpu_ptr(&up_read_work); |
294 | if (work->irq_work.flags & IRQ_WORK_BUSY) | 293 | if (work->irq_work.flags & IRQ_WORK_BUSY) |
295 | /* cannot queue more up_read, fallback */ | 294 | /* cannot queue more up_read, fallback */ |
@@ -328,7 +327,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs, | |||
328 | id_offs[i].status = BPF_STACK_BUILD_ID_VALID; | 327 | id_offs[i].status = BPF_STACK_BUILD_ID_VALID; |
329 | } | 328 | } |
330 | 329 | ||
331 | if (!in_nmi_ctx) { | 330 | if (!work) { |
332 | up_read(¤t->mm->mmap_sem); | 331 | up_read(¤t->mm->mmap_sem); |
333 | } else { | 332 | } else { |
334 | work->sem = ¤t->mm->mmap_sem; | 333 | work->sem = ¤t->mm->mmap_sem; |