Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp685131pxf; Thu, 1 Apr 2021 10:52:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw21Q+JlBVhMhfnVoXBLyXzfcnP6aFD+iNRpSnRES+MVNLJNrDuRwscwYKfVFsE/OGm9lp/ X-Received: by 2002:aa7:cc98:: with SMTP id p24mr11147545edt.187.1617299564218; Thu, 01 Apr 2021 10:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617299564; cv=none; d=google.com; s=arc-20160816; b=RpWG9Rt0DjCu6Y4dziMXF8jMMwMkEUvfiQq00n3RKpefvPEeU0Twphzz5TGtF2Lg3g k2kYmY+ucuR4KWuWinzbGi9PV/zbAIq3Cyrv7M0c2PSnPWd22qNeRZbSkUrI5YNJ3bZc X6goJtoS4e7Sw2T7xl79FVGSmDBsiYiGWJoWUACh3lCd4zWB8jlM+lP5a8XiLNkxIuTZ GtIC5+pVbQz6jclarp/vILO1ZPf586KL5nWc6plCGbPBY5lofCjSN+lcv92DsJxjuj6O MBN9iBADMmuzML3yld8ORKxSB0mA06r/Rix2GrBKc01LSiEZql0tiG32lhsIMJaJbMAc I/zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=tVWLYEbLx9qrRAgapuYCwlPSpfDrqsPipPnLTPoxCjk=; b=Dt+axjboG1pPrmbhdW4jtgk16H0ge4iI+IZDhwABkcKwaTgnxfB1Z/H8eMdjNVFyag 8Wz4GL0xnWxjN8qg7VOwj0QmO23J/S8nPEHDXJ+yBclGDvb4XDAnV/8GdWvCvd/lUouB rRKXUEXQPwdEKBBu3p8EWyzFmyOInPJPs19+DnXxkYrmteevQ6zUllQ1IohgIuCMmIXB 7NoPLm5U5GuRiCQo8rVkvn3vfB2RxMfTNAvnzFe3lj2udy//Y4tbxu53UEA5VtwOr10N ZZUn+yYVZ9grquLg54eBywrmieKDISaYHf7GFME6oWbjujZXZdQAZA50LGBX2s1yVs7a 8QMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b=WePIUIuk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si4640248edy.129.2021.04.01.10.52.21; Thu, 01 Apr 2021 10:52:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b=WePIUIuk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236875AbhDARrs (ORCPT + 99 others); Thu, 1 Apr 2021 13:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234669AbhDARjG (ORCPT ); Thu, 1 Apr 2021 13:39:06 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96892C0604DD; Thu, 1 Apr 2021 05:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Date:Message-ID:From:Cc:To; bh=tVWLYEbLx9qrRAgapuYCwlPSpfDrqsPipPnLTPoxCjk=; b=WePIUIukGL00Rl/YfKZxWGjhtg uapdRFQ/Ywc8zYtqeWUb7DPDppM8gP69QZeSjyOhtiDemnaa4YAmwOhKS3xjkDa8ZXJ4UaaLe/Tta VNnOyFbbB6jympVSxIfKj52+PBHz6MrgCcp8Bls4l7A2CGfD2/V/A5I/FEfm7iEqVcyun6j6HdIGP HZDjfaHAeoI/1CbccffIkX91EfGFblZsr2Y1W4GGHHsMvtm3SzoPNDRlBCbXoG4fQ1Bd26rAoGJq8 b9QUiLHuOmVY4cZ+3qcuFVcJMrCrFXQmLhvGbuaWIAn9SanZlUImmd25RJis0qfCFx+bN+61+OWKq PPDiDm+VwisuDSEd/cZyOAyJatw72rGmKSQrYERxKrPZhMFAabvrsdQ3tYPkdd6U+knVpFFv0nBWm 7vaocRwGggqBWBS/aH+oNUeKiA3IbCrroX+2mhbouk33yBmhVaPqQdtwAFAU0Gy8StiGl20W2XLzn csZ5A5uJgYO55ubfhoGF7CeZ; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim) id 1lRwmX-0006VC-6X; Thu, 01 Apr 2021 12:50:41 +0000 Subject: Re: [Linux-cifsd-devel] [PATCH] cifsd: use kfree to free memory allocated by kzalloc To: Namjae Jeon , Dan Carpenter Cc: COMMON INTERNET FILE SYSTEM SERVER , COMMON INTERNET FILE SYSTEM SERVER , kernel-janitors@vger.kernel.org, open list , Steve French , colin.king@canonical.com, Muhammad Usama Anjum References: <20210401113933.GA2828895@LEGION> <20210401115008.GS2088@kadam> From: Ralph Boehme Message-ID: Date: Thu, 1 Apr 2021 14:50:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zeRUUj6HNzvoePTSQnwPPm7ogV0B3n6Mm" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zeRUUj6HNzvoePTSQnwPPm7ogV0B3n6Mm Content-Type: multipart/mixed; boundary="OeIAqnNtI8gSxOZGWCTJcJ31LJ66ZGbYu"; protected-headers="v1" From: Ralph Boehme To: Namjae Jeon , Dan Carpenter Cc: COMMON INTERNET FILE SYSTEM SERVER , COMMON INTERNET FILE SYSTEM SERVER , kernel-janitors@vger.kernel.org, open list , Steve French , colin.king@canonical.com, Muhammad Usama Anjum Message-ID: Subject: Re: [Linux-cifsd-devel] [PATCH] cifsd: use kfree to free memory allocated by kzalloc References: <20210401113933.GA2828895@LEGION> <20210401115008.GS2088@kadam> In-Reply-To: --OeIAqnNtI8gSxOZGWCTJcJ31LJ66ZGbYu Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 4/1/21 um 2:43 PM schrieb Namjae Jeon: > 2021-04-01 20:50 GMT+09:00, Dan Carpenter : >> On Thu, Apr 01, 2021 at 04:39:33PM +0500, Muhammad Usama Anjum wrote: >>> kfree should be used to free memory allocated by kzalloc to avoid >>> any overhead and for maintaining consistency. >>> >>> Fixes: 5dfeb6d945 ("cifsd: use kmalloc() for small allocations") >>> Signed-off-by: Muhammad Usama Anjum >>> --- >>> This one place was left in earlier patch. I've already received >>> responsse on that patch. I'm sending a separate patch. >>> >>> fs/cifsd/transport_tcp.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/fs/cifsd/transport_tcp.c b/fs/cifsd/transport_tcp.c >>> index 67163efcf472..040881893417 100644 >>> --- a/fs/cifsd/transport_tcp.c >>> +++ b/fs/cifsd/transport_tcp.c >>> @@ -551,7 +551,7 @@ void ksmbd_tcp_destroy(void) >>> list_for_each_entry_safe(iface, tmp, &iface_list, entry) { >>> list_del(&iface->entry); >>> kfree(iface->name); >>> - ksmbd_free(iface); >>> + kfree(iface); >> >> We should just delete the ksmbd_free() function completely. > Yes, I have added your review comment about this to my todo-list. > I will do that. >> >> I think that cifsd is being re-written though so it might not be worth= >> it. > Right. fwiw, while at it what about renaming everything that still references=20 "cifs" to "smb" ? This is not the 90's... :) Cheers! -slow --OeIAqnNtI8gSxOZGWCTJcJ31LJ66ZGbYu-- --zeRUUj6HNzvoePTSQnwPPm7ogV0B3n6Mm Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEE+uLGCIokJSBRxVnkqh6bcSY5nkYFAmBlwZ8FAwAAAAAACgkQqh6bcSY5nkaP 5A/9HwRyi+MljbI8+wiUXUUq/57WIFHsgmrADXXUDSjmVFDQ6G89KyR7v0pMICklZfDj73S6JrKx A2lX4fvFyKOyEMMhU9s1EGf5z9jXC9FM+kdNbXCM9ob0l2aBc2+gZhYn5B6uwbRddqI2Pa4fvFhG gRQJkEiQ+/Ga3tRFGC9yOEqr4HOP9pv0jcQs94b4V+BoJirgyXiqtdjWsYEeQFiaqghwlNodbMex ePDrQ1XAPMl5tOon/GeqD034Ov/aHAeiirUe5WO2GtpMiRZBhbA3jrYQRrFrCjHyRsmMIG9IuwpT TfjMEFmwQperqm0cXIjR7S6DGwu3N29ciG4v2NN/R0k5cUGGth5w7XxD7VvZIL+gmxVqkn2IBffT 485ZBuAXQ1H1ohmY/+MNrF41NmnBkrM+qW3FDS1b5scB46fWEMdbLO8ebnpsdGWeLba+m+jbQ9Pp 4XE2A18/LSIzZKw/6g3gLTvmwLS97udLqHb1aWjVqHl8pm+BgGes5ghU/XUEq5588CCniLy62MCI UMepXA1hAIwSSFRQyzdIpeW/O6hygqpKbus9dDuNvwzwPscLOcnSTbDI5eToo3uqYHE6HZ8a0tPd GfhI3h6DumD+0vfkI8ga3WCyeyO/j95UZgh/2IQuKbiJcoJpBwAxw4WZjsMUoiNRTLP6El3ZJjGj E4U= =SsV9 -----END PGP SIGNATURE----- --zeRUUj6HNzvoePTSQnwPPm7ogV0B3n6Mm--