Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbdHHQfh (ORCPT ); Tue, 8 Aug 2017 12:35:37 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51457 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017AbdHHQfg (ORCPT ); Tue, 8 Aug 2017 12:35:36 -0400 Date: Tue, 8 Aug 2017 09:35:30 -0700 From: "Darrick J. Wong" To: Pan Bian Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: xfs: use kmem_free to free return value of kmem_zalloc Message-ID: <20170808163530.GP24087@magnolia> References: <1502194677-28047-1-git-send-email-bianpan2016@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502194677-28047-1-git-send-email-bianpan2016@163.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 990 Lines: 33 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 > Signed-off-by: Pan Bian > --- > 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