rcutorture: Fix error return code in rcu_perf_init()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 13 Jun 2016 15:20:39 +0000 (15:20 +0000)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 14 Jun 2016 23:03:32 +0000 (16:03 -0700)
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

index 7b2dbdffd791b9d59768097c456c7e43b788fa4e..d38ab08a3fe7eb5d92caf5b0c4d590299d912d90 100644 (file)
@@ -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)
This page took 0.025796 seconds and 5 git commands to generate.