Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1706469 > unrolled thread
| Started by | Pan Bian <bianpan2016@163.com> |
|---|---|
| First post | 2017-08-08 14:20 +0200 |
| Last post | 2017-08-08 18:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
xfs: use kmem_free to free return value of kmem_zalloc Pan Bian <bianpan2016@163.com> - 2017-08-08 14:20 +0200
Re: xfs: use kmem_free to free return value of kmem_zalloc "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-08-08 18:40 +0200
| From | Pan Bian <bianpan2016@163.com> |
|---|---|
| Date | 2017-08-08 14:20 +0200 |
| Subject | xfs: use kmem_free to free return value of kmem_zalloc |
| Message-ID | <ucbEm-8gS-9@gated-at.bofh.it> |
In function xfs_test_remount_options(), kfree() is used to free memory
allocated by kmem_zalloc(). But it is better to use kmem_free().
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
[toc] | [next] | [standalone]
| From | "Darrick J. Wong" <darrick.wong@oracle.com> |
|---|---|
| Date | 2017-08-08 18:40 +0200 |
| Message-ID | <ucfHY-2yd-23@gated-at.bofh.it> |
| In reply to | #1706469 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web