[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d0ba7af9-acd4-b5f5-8e34-9ef4af83f458@web.de>
Date: Wed, 3 Jun 2020 08:30:48 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Namjae Jeon <namjae.jeon@...sung.com>,
linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
stable@...r.kernel.org, syzkaller@...glegroups.com,
Al Viro <viro@...iv.linux.org.uk>,
Sungjong Seo <sj1557.seo@...sung.com>,
Xiaolong Huang <butterflyhuangxx@...il.com>
Subject: Re: [PATCH v2] exfat: fix memory leak in exfat_parse_param()
> Additionally, there's no point copying param->string in
> exfat_parse_param() - just steal it, leaving NULL in param->string.
> That's independent from the leak or fix thereof - it's simply
> avoiding an extra copy.
I find it clearer to provide such a source code adjustment
by a separate update step.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=d6f9469a03d832dcd17041ed67774ffb5f3e73b3#n138
Please move it into another patch.
…
> +++ b/fs/exfat/super.c
…
> @@ -686,7 +685,12 @@ static int exfat_get_tree(struct fs_context *fc)
>
> static void exfat_free(struct fs_context *fc)
> {
> - kfree(fc->s_fs_info);
> + struct exfat_sb_info *sbi = fc->s_fs_info;
> +
> + if (sbi) {
> + exfat_free_iocharset(sbi);
> + kfree(sbi);
> + }
> }
…
Can it be helpful to annotate the added check according to branch prediction?
Are valid pointers likely at this place?
Regards,
Markus
Powered by blists - more mailing lists