If the 'kmalloc' fails, we must go through the existing error handling
path.
Signed-off-by: Christophe JAILLET <[email protected]>
---
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
On 09/11/2017 01:43 PM, Christophe JAILLET wrote:
> If the 'kmalloc' fails, we must go through the existing error handling
> path.
Looks good to me, probably wants a
Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
line as well.
--
Jens Axboe
Le 11/09/2017 à 21:52, Jens Axboe a écrit :
> On 09/11/2017 01:43 PM, Christophe JAILLET wrote:
>> If the 'kmalloc' fails, we must go through the existing error handling
>> path.
> Looks good to me, probably wants a
>
> Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
>
> line as well.
>
Hi,
do you want me to resend with the Fixes tag? Or will it be added if merged?
CJ
On 09/11/2017 02:04 PM, Christophe JAILLET wrote:
> Le 11/09/2017 à 21:52, Jens Axboe a écrit :
>> On 09/11/2017 01:43 PM, Christophe JAILLET wrote:
>>> If the 'kmalloc' fails, we must go through the existing error handling
>>> path.
>> Looks good to me, probably wants a
>>
>> Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
>>
>> line as well.
>>
> Hi,
>
> do you want me to resend with the Fixes tag? Or will it be added if merged?
Shouldn't be necessary to resend. Not sure who will queue it up, mm/ always
ends up being somewhat of a no-mans-land :-)
--
Jens Axboe
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 <[email protected]>
Looks good to me. You can add:
Reviewed-by: Jan Kara <[email protected]>
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 <[email protected]>
SUSE Labs, CR
On 09/11/2017 02:15 PM, Jan Kara wrote:
> 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 <[email protected]>
>
> Looks good to me. You can add:
>
> Reviewed-by: Jan Kara <[email protected]>
I'll queue it up, with your reviewed-by added. Thanks.
--
Jens Axboe