i386: Remove unneeded test of 'task' in dump_trace() (again)
PATCH 1/1 i386: Remove unneeded test of 'task' in dump_trace() (again)
Commit 028a690a1ebc8b "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 2bc5f927d489 "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 8a541665b906 "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 028a690a1ebc8b.
Commit d0caf292505d "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.
--- arch/x86/kernel/dumpstack_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/dumpstack_32.c +1 -1
@@ -53,7 +53,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,unsigned long dummy; stack = &dummy; -if (task && task != current) +if (task != current) stack = (unsigned long *)task->thread.sp; }
Signature · 1 line
1.8.1.4
Quoted 24 lines · Steven Rostedt
Commit
028a690a1ebc8b"i386: Remove unneeded test of 'task' indump_trace()" correctly removed the unneeded 'task != NULL' check because it would be set to current if it was NULL.Commit
2bc5f927d489"i386: split out dumpstack code fromtraps_32.c" moved the code fromtraps_32.cto its own filedump_stack.cfor preparation of the i386 /x86_64merge.Commit
8a541665b906"dumpstack: x86: various small unification steps" worked to make i386 andx86_64dump_stacklogic similar. But this actually reverted the correct change from028a690a1ebc8b.Commit
d0caf292505d"x86/dumpstack: Remove unneeded check indump_trace()" removed the unneeded "task != NULL" check forx86_64but left that same unneeded check for i386, that was added becausex86_64had it!This chain of events ironically had i386 add back the unneeded task != NULL check because
x86_64did it, and then the fix forx86_64was fixed by Dan. And even more ironically, it was Dan's smatch bot that told me that a change todump_stack_32I 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.
Quoted 3 lines
Reported-by Dan Carpenter <[email protected]>Cc Jesper Juhl <[email protected]>Cc Alexander van Heukelum <[email protected]>
Great archeology ;)
Quoted 21 lines
Signed-off-by Steven Rostedt <[email protected]>--- arch/x86/kernel/dumpstack_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/dumpstack_32.c +1
-1@@ -53,7 +53,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,unsigned long dummy; stack = &dummy; -if (task && task != current) +if (task != current) stack = (unsigned long *)task->thread.sp; }Signature · 1 line
1.8.1.4
tip-bot for Steven Rostedt
merge boti386: Remove unneeded test of 'task' in dump_trace() (again)
Commit-ID: 7743a536beda6225eef4a0758c5370f761fb0616 Gitweb: http://git.kernel.org/tip/7743a536beda6225eef4a0758c5370f761fb0616 Author: Steven Rostedt <[email protected]> AuthorDate: Fri, 7 Mar 2014 10:52:42 -0500 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 11 Mar 2014 12:02:31 +0100
i386: Remove unneeded test of 'task' in dump_trace() (again)
Commit 028a690a1ebc8b "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 2bc5f927d489 "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 8a541665b906 "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 028a690a1ebc8b.
Commit d0caf292505d "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.
--- arch/x86/kernel/dumpstack_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/dumpstack_32.c +1 -1
@@ -30,7 +30,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,unsigned long dummy; stack = &dummy; -if (task && task != current) +if (task != current) stack = (unsigned long *)task->thread.sp; }