From: "bibo,mao" In IA64 architecture, args->regs may be NULL when machine_restart calls notify_die function. This patch modifies this, for safety regs NULL value checking is added in other architecture. Thanks to YanMin for pointing out this. This patch is against 2.6.16-rc5-mm1. Signed-off-by: bibo mao Signed-off-by: Andrew Morton --- arch/i386/kernel/kprobes.c | 2 +- arch/ia64/kernel/kprobes.c | 2 +- arch/powerpc/kernel/kprobes.c | 2 +- arch/sparc64/kernel/kprobes.c | 2 +- arch/x86_64/kernel/kprobes.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff -puN arch/i386/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 arch/i386/kernel/kprobes.c --- devel/arch/i386/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 2006-03-03 23:54:33.000000000 -0800 +++ devel-akpm/arch/i386/kernel/kprobes.c 2006-03-03 23:54:33.000000000 -0800 @@ -567,7 +567,7 @@ int __kprobes kprobe_exceptions_notify(s struct die_args *args = (struct die_args *)data; int ret = NOTIFY_DONE; - if (user_mode(args->regs)) + if (args->regs && user_mode(args->regs)) return ret; switch (val) { diff -puN arch/ia64/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 arch/ia64/kernel/kprobes.c --- devel/arch/ia64/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 2006-03-03 23:54:33.000000000 -0800 +++ devel-akpm/arch/ia64/kernel/kprobes.c 2006-03-03 23:54:33.000000000 -0800 @@ -740,7 +740,7 @@ int __kprobes kprobe_exceptions_notify(s struct die_args *args = (struct die_args *)data; int ret = NOTIFY_DONE; - if (user_mode(args->regs)) + if (args->regs && user_mode(args->regs)) return ret; switch(val) { diff -puN arch/powerpc/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 arch/powerpc/kernel/kprobes.c --- devel/arch/powerpc/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 2006-03-03 23:54:33.000000000 -0800 +++ devel-akpm/arch/powerpc/kernel/kprobes.c 2006-03-03 23:54:33.000000000 -0800 @@ -396,7 +396,7 @@ int __kprobes kprobe_exceptions_notify(s struct die_args *args = (struct die_args *)data; int ret = NOTIFY_DONE; - if (user_mode(args->regs)) + if (args->regs && user_mode(args->regs)) return ret; switch (val) { diff -puN arch/sparc64/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 arch/sparc64/kernel/kprobes.c --- devel/arch/sparc64/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 2006-03-03 23:54:33.000000000 -0800 +++ devel-akpm/arch/sparc64/kernel/kprobes.c 2006-03-03 23:54:33.000000000 -0800 @@ -324,7 +324,7 @@ int __kprobes kprobe_exceptions_notify(s struct die_args *args = (struct die_args *)data; int ret = NOTIFY_DONE; - if (user_mode(args->regs)) + if (args->regs && user_mode(args->regs)) return ret; switch (val) { diff -puN arch/x86_64/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 arch/x86_64/kernel/kprobes.c --- devel/arch/x86_64/kernel/kprobes.c~kprobe-handler-discard-user-space-trap-fix-2 2006-03-03 23:54:33.000000000 -0800 +++ devel-akpm/arch/x86_64/kernel/kprobes.c 2006-03-03 23:54:33.000000000 -0800 @@ -601,7 +601,7 @@ int __kprobes kprobe_exceptions_notify(s struct die_args *args = (struct die_args *)data; int ret = NOTIFY_DONE; - if (user_mode(args->regs)) + if (args->regs && user_mode(args->regs)) return ret; switch (val) { _