linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] rcutorture: Fix error return code in rcu_perf_init()
@ 2016-06-13 15:20 weiyj_lk
  2016-06-13 16:52 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2016-06-13 15:20 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan
  Cc: Wei Yongjun, linux-kernel

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>
---
 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 7b2dbdf..d38ab08 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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] rcutorture: Fix error return code in rcu_perf_init()
  2016-06-13 15:20 [PATCH -next] rcutorture: Fix error return code in rcu_perf_init() weiyj_lk
@ 2016-06-13 16:52 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2016-06-13 16:52 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Josh Triplett, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan,
	Wei Yongjun, linux-kernel

On Mon, Jun 13, 2016 at 03:20:39PM +0000, weiyj_lk@163.com wrote:
> 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>

Good eyes!  Queued for review and testing.

							Thanx, Paul

> ---
>  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 7b2dbdf..d38ab08 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)
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 15:20 [PATCH -next] rcutorture: Fix error return code in rcu_perf_init() weiyj_lk
2016-06-13 16:52 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).