public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfs: use kmem_free to free return value of kmem_zalloc
@ 2017-08-08 12:17 Pan Bian
  2017-08-08 16:35 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Pan Bian @ 2017-08-08 12:17 UTC (permalink / raw)
  To: Darrick J. Wong, linux-xfs; +Cc: linux-kernel, Pan Bian

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: xfs: use kmem_free to free return value of kmem_zalloc
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2017-08-08 16:35 UTC (permalink / raw)
  To: Pan Bian; +Cc: linux-xfs, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-08 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox