]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
locktorture: Check the correct variable for allocation failure
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 28 Sep 2023 07:06:11 +0000 (10:06 +0300)
committerFrederic Weisbecker <frederic@kernel.org>
Wed, 11 Oct 2023 13:55:26 +0000 (15:55 +0200)
There is a typo so this checks the wrong variable.  "chains" plural vs
"chain" singular.  We already know that "chains" is non-zero.

Fixes: 7f993623e9eb ("locktorture: Add call_rcu_chains module parameter")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
kernel/locking/locktorture.c

index a3abcd136f56cb5fa957419d14f7b294e5718ccc..69d3cd2cfc3baf1062b6a785eeca2a834fca0171 100644 (file)
@@ -1075,7 +1075,7 @@ static int call_rcu_chain_init(void)
        if (call_rcu_chains <= 0)
                return 0;
        call_rcu_chain = kcalloc(call_rcu_chains, sizeof(*call_rcu_chain), GFP_KERNEL);
-       if (!call_rcu_chains)
+       if (!call_rcu_chain)
                return -ENOMEM;
        for (i = 0; i < call_rcu_chains; i++) {
                call_rcu_chain[i].crc_stop = false;