From: Hou Pengyang <houpengyang@huawei.com>
To: Kinglong Mee <kinglongmee@gmail.com>
Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/3] f2fs: fix a memleak issue
Date: Tue, 28 Feb 2017 10:06:31 +0800 [thread overview]
Message-ID: <58B4DB27.2090709@huawei.com> (raw)
In-Reply-To: <072cd19e-773a-af22-01bd-84d219b670c3@gmail.com>
On 2017/2/27 21:52, Kinglong Mee wrote:
> On 2/27/2017 21:02, Hou Pengyang wrote:
>> [fix: ae75f0ca76 f2fs: introduce free nid bitmap]
>> Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
>> ---
>> fs/f2fs/node.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>> index 6d43095..353c01d 100644
>> --- a/fs/f2fs/node.c
>> +++ b/fs/f2fs/node.c
>> @@ -2650,8 +2650,11 @@ int init_free_nid_cache(struct f2fs_sb_info *sbi)
>>
>> nm_i->nat_block_bitmap = f2fs_kvzalloc(nm_i->nat_blocks / 8,
>> GFP_KERNEL);
>> - if (!nm_i->nat_block_bitmap)
>> + if (!nm_i->nat_block_bitmap) {
>> + kvfree(nm_i->free_nid_bitmap);
>> return -ENOMEM;
>> + }
>> +
>> return 0;
>> }
>
> If building node manager fail, destroy_node_manager will be called,
> I think there isn't any memory leak exist, right?
>
> err = build_node_manager(sbi);
> if (err) {
> f2fs_msg(sb, KERN_ERR,
> "Failed to initialize F2FS node manager");
> goto free_nm;
> }
>
>
Yup, I missed it :)
Thank you,
> thanks,
> Kinglong Mee
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
prev parent reply other threads:[~2017-02-28 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-27 13:02 [PATCH 1/3] f2fs: fix a memleak issue Hou Pengyang
2017-02-27 13:02 ` [PATCH 2/3] f2fs: add f2fs_drop_inode tracepoint Hou Pengyang
2017-02-27 13:02 ` [PATCH 3/3] f2fs: fix a plint compile warning Hou Pengyang
2017-02-27 13:52 ` [PATCH 1/3] f2fs: fix a memleak issue Kinglong Mee
2017-02-28 2:06 ` Hou Pengyang [this message]
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=58B4DB27.2090709@huawei.com \
--to=houpengyang@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=kinglongmee@gmail.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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.