]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
rcu: Fix uninitialized variable in nocb_gp_wait()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 23 Sep 2019 14:26:34 +0000 (17:26 +0300)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 30 Oct 2019 15:34:53 +0000 (08:34 -0700)
We never set this to false.  This probably doesn't affect most people's
runtime because GCC will automatically initialize it to false at certain
common optimization levels.  But that behavior is related to a bug in
GCC and obviously should not be relied on.

Fixes: 5d6742b37727 ("rcu/nocb: Use rcu_segcblist for no-CBs CPUs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_plugin.h

index 2defc7fe74c3991b03d1968a18c4d208bccf25f9..fa08d55f7040c0aa6a9976b328cb8c49195824d6 100644 (file)
@@ -1946,7 +1946,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp)
        int __maybe_unused cpu = my_rdp->cpu;
        unsigned long cur_gp_seq;
        unsigned long flags;
-       bool gotcbs;
+       bool gotcbs = false;
        unsigned long j = jiffies;
        bool needwait_gp = false; // This prevents actual uninitialized use.
        bool needwake;