Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

locktorture: Check the correct variable for allocation failure

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>

authored by

Dan Carpenter and committed by
Frederic Weisbecker
cefe8ce5 3e9b009c

+1 -1
+1 -1
kernel/locking/locktorture.c
··· 1075 1075 if (call_rcu_chains <= 0) 1076 1076 return 0; 1077 1077 call_rcu_chain = kcalloc(call_rcu_chains, sizeof(*call_rcu_chain), GFP_KERNEL); 1078 - if (!call_rcu_chains) 1078 + if (!call_rcu_chain) 1079 1079 return -ENOMEM; 1080 1080 for (i = 0; i < call_rcu_chains; i++) { 1081 1081 call_rcu_chain[i].crc_stop = false;