Skip to content

Commit 36b5dae

Browse files
committed
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 <[email protected]> Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
1 parent b8889c9 commit 36b5dae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/rcu/rcu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ static inline void rcu_init_levelspread(int *levelspread, const int *levelcnt)
299299
{
300300
int i;
301301

302+
for (i = 0; i < RCU_NUM_LVLS; i++)
303+
levelspread[i] = INT_MIN;
302304
if (rcu_fanout_exact) {
303305
levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
304306
for (i = rcu_num_lvls - 2; i >= 0; i--)

0 commit comments

Comments
 (0)