Commit 7743a536 authored by Steven Rostedt's avatar Steven Rostedt Committed by Ingo Molnar

i386: Remove unneeded test of 'task' in dump_trace() (again)

Commit 028a690a "i386: Remove unneeded test of 'task' in
dump_trace()" correctly removed the unneeded 'task != NULL'
check because it would be set to current if it was NULL.

Commit 2bc5f927 "i386: split out dumpstack code from
traps_32.c" moved the code from traps_32.c to its own file
dump_stack.c for preparation of the i386 / x86_64 merge.

Commit 8a541665 "dumpstack: x86: various small unification
steps" worked to make i386 and x86_64 dump_stack logic similar.
But this actually reverted the correct change from
028a690a.

Commit d0caf292 "x86/dumpstack: Remove unneeded check in
dump_trace()" removed the unneeded "task != NULL" check for
x86_64 but left that same unneeded check for i386, that was
added because x86_64 had it!

This chain of events ironically had i386 add back the unneeded
task != NULL check because x86_64 did it, and then the fix for
x86_64 was fixed by Dan. And even more ironically, it was Dan's
smatch bot that told me that a change to dump_stack_32 I made
may be wrong if current can be NULL (it can't), as there was a
check for it by assigning task to current, and then checking if
task is NULL.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Acked-by: default avatarAlexander van Heukelum <heukelum@fastmail.fm>
Cc: Jesper Juhl <jesper.juhl@gmail.com>
Link: http://lkml.kernel.org/r/20140307105242.79a0befd@gandalf.local.homeSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 8712a005
...@@ -30,7 +30,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, ...@@ -30,7 +30,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
unsigned long dummy; unsigned long dummy;
stack = &dummy; stack = &dummy;
if (task && task != current) if (task != current)
stack = (unsigned long *)task->thread.sp; stack = (unsigned long *)task->thread.sp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment