From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Pan Bian <bianpan2016@163.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: xfs: use kmem_free to free return value of kmem_zalloc
Date: Tue, 8 Aug 2017 09:35:30 -0700 [thread overview]
Message-ID: <20170808163530.GP24087@magnolia> (raw)
In-Reply-To: <1502194677-28047-1-git-send-email-bianpan2016@163.com>
On Tue, Aug 08, 2017 at 08:17:57PM +0800, Pan Bian wrote:
> In function xfs_test_remount_options(), kfree() is used to free memory
> allocated by kmem_zalloc(). But it is better to use kmem_free().
Looks fine (for 4.14),
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> fs/xfs/xfs_super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 38aaacd..c1c4c2e 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1220,7 +1220,7 @@ struct proc_xfs_info {
> tmp_mp->m_super = sb;
> error = xfs_parseargs(tmp_mp, options);
> xfs_free_fsname(tmp_mp);
> - kfree(tmp_mp);
> + kmem_free(tmp_mp);
>
> return error;
> }
> --
> 1.9.1
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-08-08 16:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 12:17 xfs: use kmem_free to free return value of kmem_zalloc Pan Bian
2017-08-08 16:35 ` Darrick J. Wong [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=20170808163530.GP24087@magnolia \
--to=darrick.wong@oracle.com \
--cc=bianpan2016@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox