All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: axboe@fb.com, jack@suse.cz, tj@kernel.org, geliangtang@gmail.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Date: Mon, 11 Sep 2017 22:15:06 +0200	[thread overview]
Message-ID: <20170911201506.GA15044@quack2.suse.cz> (raw)
In-Reply-To: <20170911194323.17833-1-christophe.jaillet@wanadoo.fr>

On Mon 11-09-17 21:43:23, Christophe JAILLET wrote:
> If the 'kmalloc' fails, we must go through the existing error handling
> path.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/backing-dev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index f028a9a472fd..e19606bb41a0 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
>  
>  	/* need to create a new one */
>  	wb = kmalloc(sizeof(*wb), gfp);
> -	if (!wb)
> -		return -ENOMEM;
> +	if (!wb) {
> +		ret = -ENOMEM;
> +		goto out_put;
> +	}
>  
>  	ret = wb_init(wb, bdi, blkcg_css->id, gfp);
>  	if (ret)
> -- 
> 2.11.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: axboe@fb.com, jack@suse.cz, tj@kernel.org, geliangtang@gmail.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Date: Mon, 11 Sep 2017 20:15:06 +0000	[thread overview]
Message-ID: <20170911201506.GA15044@quack2.suse.cz> (raw)
In-Reply-To: <20170911194323.17833-1-christophe.jaillet@wanadoo.fr>

On Mon 11-09-17 21:43:23, Christophe JAILLET wrote:
> If the 'kmalloc' fails, we must go through the existing error handling
> path.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/backing-dev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index f028a9a472fd..e19606bb41a0 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
>  
>  	/* need to create a new one */
>  	wb = kmalloc(sizeof(*wb), gfp);
> -	if (!wb)
> -		return -ENOMEM;
> +	if (!wb) {
> +		ret = -ENOMEM;
> +		goto out_put;
> +	}
>  
>  	ret = wb_init(wb, bdi, blkcg_css->id, gfp);
>  	if (ret)
> -- 
> 2.11.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: axboe@fb.com, jack@suse.cz, tj@kernel.org, geliangtang@gmail.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Date: Mon, 11 Sep 2017 22:15:06 +0200	[thread overview]
Message-ID: <20170911201506.GA15044@quack2.suse.cz> (raw)
In-Reply-To: <20170911194323.17833-1-christophe.jaillet@wanadoo.fr>

On Mon 11-09-17 21:43:23, Christophe JAILLET wrote:
> If the 'kmalloc' fails, we must go through the existing error handling
> path.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/backing-dev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index f028a9a472fd..e19606bb41a0 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
>  
>  	/* need to create a new one */
>  	wb = kmalloc(sizeof(*wb), gfp);
> -	if (!wb)
> -		return -ENOMEM;
> +	if (!wb) {
> +		ret = -ENOMEM;
> +		goto out_put;
> +	}
>  
>  	ret = wb_init(wb, bdi, blkcg_css->id, gfp);
>  	if (ret)
> -- 
> 2.11.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2017-09-11 20:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 19:43 [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()' Christophe JAILLET
2017-09-11 19:43 ` Christophe JAILLET
2017-09-11 19:43 ` Christophe JAILLET
2017-09-11 19:52 ` Jens Axboe
2017-09-11 19:52   ` Jens Axboe
2017-09-11 19:52   ` Jens Axboe
2017-09-11 20:04   ` Christophe JAILLET
2017-09-11 20:04     ` Christophe JAILLET
2017-09-11 20:04     ` Christophe JAILLET
2017-09-11 20:07     ` Jens Axboe
2017-09-11 20:07       ` Jens Axboe
2017-09-11 20:07       ` Jens Axboe
2017-09-11 20:15 ` Jan Kara [this message]
2017-09-11 20:15   ` Jan Kara
2017-09-11 20:15   ` Jan Kara
2017-09-11 20:17   ` Jens Axboe
2017-09-11 20:17     ` Jens Axboe
2017-09-11 20:17     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170911201506.GA15044@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@fb.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=geliangtang@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.