Commit 4c115e951d80aff126468adaec7a6c7854f61ab8

Authored by Darren Hart
Committed by Thomas Gleixner
1 parent 814ce25211

futex: Address compiler warnings in exit_robust_list

Since commit 1dcc41bb (futex: Change 3rd arg of fetch_robust_entry()
to unsigned int*) some gcc versions decided to emit the following
warning:

kernel/futex.c: In function ‘exit_robust_list’:
kernel/futex.c:2492: warning: ‘next_pi’ may be used uninitialized in this function

The commit did not introduce the warning as gcc should have warned
before that commit as well. It's just gcc being silly.

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.

[ tglx: Addressed the same issue in futex_compat.c and massaged the
  	changelog ]

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: Peter Zijlstra <peterz@infradead.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <1288897200-13008-1-git-send-email-dvhart@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Showing 2 changed files with 4 additions and 2 deletions Side-by-side Diff

... ... @@ -2489,7 +2489,8 @@
2489 2489 {
2490 2490 struct robust_list_head __user *head = curr->robust_list;
2491 2491 struct robust_list __user *entry, *next_entry, *pending;
2492   - unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
  2492 + unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
  2493 + unsigned int uninitialized_var(next_pi);
2493 2494 unsigned long futex_offset;
2494 2495 int rc;
2495 2496  
kernel/futex_compat.c
... ... @@ -49,7 +49,8 @@
49 49 {
50 50 struct compat_robust_list_head __user *head = curr->compat_robust_list;
51 51 struct robust_list __user *entry, *next_entry, *pending;
52   - unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip;
  52 + unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;
  53 + unsigned int uninitialized_var(next_pi);
53 54 compat_uptr_t uentry, next_uentry, upending;
54 55 compat_long_t futex_offset;
55 56 int rc;