lkml.org 
[lkml]   [2010]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2] futex: fix compiler warnings in exit_robust_list
Date
The following commit introduced a compiler warning:

Commit 1dcc41bb037533839753df983d31778b30b67d93
futex: Change 3rd arg of fetch_robust_entry() to unsigned int*

The following archs/compiler versions all report:
kernel/futex.c: In function ‘exit_robust_list’:
kernel/futex.c:2492: warning: ‘next_pi’ may be used uninitialized in this function

x86_64
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

sh
sh-linux-gnu-gcc (Sourcery G++ Lite 4.3-143) 4.3.3

arm
arm-1136jfs-linux-gnueabi-gcc (OSELAS.Toolchain-1.99.3) 4.3.2

The code path really can't result in next_pi being unitialized (or should
not), but let's keep the build clean. Annotate next_pi as an uninitialized_var.

V2: Implement Uwe's suggestion to use uninitialized_var()

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Tested-by: Matt Fleming <matt@console-pimps.org>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: John Kacur <jkacur@redhat.com>
---
kernel/futex.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 6c683b3..40a8777 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, pip;
+ unsigned int uninitialized_var(next_pi);
unsigned long futex_offset;
int rc;

--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-11-04 20:03    [W:0.087 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site