ARM: perf: Check that current->mm is alive before getting user callchain
authorJean Pihet <jean.pihet@linaro.org>
Mon, 7 Jul 2014 13:45:08 +0000 (14:45 +0100)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 20 Feb 2015 22:05:25 +0000 (00:05 +0200)
An event may occur when an mm is already released.

As per commit 20afc60f892d285fde179ead4b24e6a7938c2f1b
 'x86, perf: Check that current->mm is alive before getting user callchain'

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event.c

index 4a2db48..c024d37 100644 (file)
@@ -804,6 +804,10 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
 
 
        perf_callchain_store(entry, regs->ARM_pc);
+
+       if (!current->mm)
+               return;
+
        tail = (struct frame_tail __user *)regs->ARM_fp - 1;
 
        while ((entry->nr < PERF_MAX_STACK_DEPTH) &&