Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423529

[PATCH tip/core/rcu 14/14] rcutorture: Fix error return code in rcu_perf_init()

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH tip/core/rcu 14/14] rcutorture: Fix error return code in rcu_perf_init()
Date 2016-06-16 00:20 +0200
Message-ID <rKrkd-8p8-17@gated-at.bofh.it> (permalink)
References <rKray-8lC-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code -ENOMEM from kcalloc() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/rcuperf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index 7b2dbdffd791..d38ab08a3fe7 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -638,8 +638,10 @@ rcu_perf_init(void)
 		writer_durations[i] =
 			kcalloc(MAX_MEAS, sizeof(*writer_durations[i]),
 				GFP_KERNEL);
-		if (!writer_durations[i])
+		if (!writer_durations[i]) {
+			firsterr = -ENOMEM;
 			goto unwind;
+		}
 		firsterr = torture_create_kthread(rcu_perf_writer, (void *)i,
 						  writer_tasks[i]);
 		if (firsterr)
-- 
2.5.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip/core/rcu 0/14] Torture-test changes for 4.8 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:10 +0200
  [PATCH tip/core/rcu 13/14] torture: Inflict default jitter "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 06/14] torture: Stop onoff task if there is only one cpu "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 04/14] torture:  Break online and offline functions out of torture_onoff() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 12/14] rcuperf: Don't treat gp_exp mis-setting as a WARN "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 07/14] rcutorture/doc: Create initrd using dracut "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 09/14] rcutorture: Make -soundhw a x86 specific option "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 14/14] rcutorture: Fix error return code in rcu_perf_init() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 08/14] rcutorture: Use vmlinux as the fallback kernel image "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 01/14] torture: Simplify code, eliminate RCU_PERF_TEST_RUNNABLE "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 10/14] rcutorture: Don't specify the cpu type of QEMU on PPC "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 11/14] rcutorture: Drop "-soundhw pcspkr" from x86 boot arguments "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 05/14] torture: Add starvation events to error summary "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200
  [PATCH tip/core/rcu 02/14] torture: Remove CONFIG_RCU_TORTURE_TEST_RUNNABLE, simplify code "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-06-16 00:20 +0200

csiph-web