linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Namhyung Kim <namhyung@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Clemens Ladisch <clemens@ladisch.de>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] x86, dumpstack: removed unneeded check in dump_trace()
Date: Sat, 28 Jan 2012 12:00:36 +0100	[thread overview]
Message-ID: <20120128110034.GD3391@somewhere> (raw)
In-Reply-To: <20120128105246.GA25092@elgon.mountain>

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@oracle.com>

Acked-by: Frederic Weisbecker <fweisbec@gmail.com>

> 
> 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;

  reply	other threads:[~2012-01-28 11:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-28 10:52 [patch] x86, dumpstack: removed unneeded check in dump_trace() Dan Carpenter
2012-01-28 11:00 ` Frederic Weisbecker [this message]
2012-01-30 13:20 ` [tip:perf/urgent] x86/dumpstack: Remove " tip-bot for Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120128110034.GD3391@somewhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=clemens@ladisch.de \
    --cc=dan.carpenter@oracle.com \
    --cc=hpa@zytor.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).