Re: [patch] x86, dumpstack: removed unneeded check in dump_trace()

From: Frederic Weisbecker
Date: Sat Jan 28 2012 - 06:01:10 EST


On Sat, Jan 28, 2012 at 01:52:46PM +0300, Dan Carpenter wrote:
> Smatch complains that we have some inconsistent NULL checking. If
> "task" were NULL then it would lead to a NULL dereference later. We
> can remove this test because earlier on in the function we have:
> if (!task)
> task = current;
>
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Acked-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>

>
> diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
> index 6d728d9..af7785f 100644
> --- a/arch/x86/kernel/dumpstack_64.c
> +++ b/arch/x86/kernel/dumpstack_64.c
> @@ -129,7 +129,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
> if (!stack) {
> if (regs)
> stack = (unsigned long *)regs->sp;
> - else if (task && task != current)
> + else if (task != current)
> stack = (unsigned long *)task->thread.sp;
> else
> stack = &dummy;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/