public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: Sergio Aguirre <saaguirre@ti.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>, Namhyung Kim <namhyung@gmail.com>
Subject: Re: [RFC][PATCH] futex: Hide false positive about uninit var usage
Date: Tue, 16 Nov 2010 08:43:24 -0800	[thread overview]
Message-ID: <4CE2B4AC.5080606@linux.intel.com> (raw)
In-Reply-To: <1289925157-17054-1-git-send-email-saaguirre@ti.com>

On 11/16/2010 08:32 AM, Sergio Aguirre wrote:
> In exit_robust_list, there was this warning shown:
>
> kernel/futex.c: In function 'exit_robust_list':
> kernel/futex.c:2492: warning: 'next_pi' may be used uninitialized in this function
>
> Which is a false positive, since in the function, the only scenario
> possible in which the var is read, is after a successful excecution of
> fetch_robust_entry, which populates the variable.
>
> So there's no real possibility of it being used uninitialized.

Hi Sergio,

You are correct. Thomas has recently pulled my fix for this into tip, it 
should be queued for mainline already.

Thanks,

Darren Hart

>
> Signed-off-by: Sergio Aguirre<saaguirre@ti.com>
> Cc: Thomas Gleixner<tglx@linutronix.de>
> Cc: Peter Zijlstra<a.p.zijlstra@chello.nl>
> Cc: Darren Hart<dvhart@linux.intel.com>
> Cc: Ingo Molnar<mingo@elte.hu>
> Cc: Namhyung Kim<namhyung@gmail.com>
> ---
>   kernel/futex.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 6c683b3..3646157 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -2489,7 +2489,8 @@ void exit_robust_list(struct task_struct *curr)
>   {
>   	struct robust_list_head __user *head = curr->robust_list;
>   	struct robust_list __user *entry, *next_entry, *pending;
> -	unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
> +	unsigned int limit = ROBUST_LIST_LIMIT, pi;
> +	unsigned int uninitialized_var(next_pi), pip;
>   	unsigned long futex_offset;
>   	int rc;
>


-- 
Darren Hart
Yocto Linux Kernel

  reply	other threads:[~2010-11-16 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 16:32 [RFC][PATCH] futex: Hide false positive about uninit var usage Sergio Aguirre
2010-11-16 16:43 ` Darren Hart [this message]
2010-11-16 16:59   ` Aguirre, Sergio
2010-11-16 17:30     ` Darren Hart

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=4CE2B4AC.5080606@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@gmail.com \
    --cc=saaguirre@ti.com \
    --cc=tglx@linutronix.de \
    /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