mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 00:39:48 +00:00
rcu: Suppress levelspread uninitialized messages
New tools bring new warnings, and with v5.3 comes: kernel/rcu/srcutree.c: warning: 'levelspread[<U aa0>]' may be used uninitialized in this function [-Wuninitialized]: => 121:34 This commit suppresses this warning by initializing the full array to INT_MIN, which will result in failures should any out-of-bounds references appear. Reported-by: Michael Ellerman <mpe@ellerman.id.au> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
b8889c9c89
commit
36b5dae645
1 changed files with 2 additions and 0 deletions
|
@ -299,6 +299,8 @@ static inline void rcu_init_levelspread(int *levelspread, const int *levelcnt)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < RCU_NUM_LVLS; i++)
|
||||||
|
levelspread[i] = INT_MIN;
|
||||||
if (rcu_fanout_exact) {
|
if (rcu_fanout_exact) {
|
||||||
levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
|
levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
|
||||||
for (i = rcu_num_lvls - 2; i >= 0; i--)
|
for (i = rcu_num_lvls - 2; i >= 0; i--)
|
||||||
|
|
Loading…
Reference in a new issue