]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
s390/ftrace: add ftrace_graph_is_dead() check
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 27 Oct 2014 14:49:06 +0000 (15:49 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 28 Oct 2014 08:24:12 +0000 (09:24 +0100)
Add an ftrace_graph_is_dead() check to prepare_ftrace_return() in order to
detect an internal ftrace graph error. This allows to prevent further ftrace
graph handling and hopefully keeps the kernel alive.

This patch is the same like for all other architectures.
For unkown reasons s390 was left out.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/ftrace.c

index 51d14fe5eb9a318349876eb376b359695770a0a2..ca1cabb3a96c1ba98062ce399803805cb9743858 100644 (file)
@@ -121,6 +121,8 @@ unsigned long __kprobes prepare_ftrace_return(unsigned long parent,
 {
        struct ftrace_graph_ent trace;
 
+       if (unlikely(ftrace_graph_is_dead()))
+               goto out;
        if (unlikely(atomic_read(&current->tracing_graph_pause)))
                goto out;
        ip = (ip & PSW_ADDR_INSN) - MCOUNT_INSN_SIZE;