rcu: Limit rcu_state::levelcnt[] to RCU_NUM_LVLS items
rcu: Limit rcu_state::levelcnt[] to RCU_NUM_LVLS items

Variable rcu_num_lvls is limited by RCU_NUM_LVLS macro.
In turn, rcu_state::levelcnt[] array is never accessed
beyond rcu_num_lvls. Thus, rcu_state::levelcnt[] is safe
to limit to RCU_NUM_LVLS items.

Since rcu_num_lvls could be changed during boot (as result
of rcutree.rcu_fanout_leaf kernel parameter update) one might
assume a new value could overflow the value of RCU_NUM_LVLS.
However, that is not the case, since leaf-level fanout is only
permitted to increase, resulting in rcu_num_lvls possibly to
decrease.

Cc: "Paul E. McKenney" <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Signed-off-by: Alexander Gordeev <840ef8418a045e2a597676027ea56f79bb2faf20@redhat.com>
Signed-off-by: Paul E. McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs