Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp695953pxf; Thu, 1 Apr 2021 11:07:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiBQFxZBbe+PGhYfEKkkUUvIKTqgka2CSRvS5AT/OnjIqmpyBXzbAgm563TR/Yjq0Y8lLz X-Received: by 2002:a17:906:1c98:: with SMTP id g24mr10488879ejh.51.1617300458744; Thu, 01 Apr 2021 11:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617300458; cv=none; d=google.com; s=arc-20160816; b=w/vnUOM2dBHU/eg5mE+Q+7gnWh8HF3PHoGnzjs44GhIutiK/BLHAZ4YTxJU43e3r29 zPbwSv+aawKwk5fZ8jUkpY/y8EUimtidNjiZjFZc+ornPWAEPII2fh2uldj7vIbU81lG zUkwqMaq3PB2g0QnQRAvhkzhBEUEv7OaNMkmj7+QmUujTdEqSi0VqTc0JmHvdOS4qNyi 5l0GmlGSODy5949FWIvbvsTAAQd3UM7uk+gFGlruk8EsubFBaTzi0TdIGMfdIbomtb/T 2RxOZQi5kLdrlRssTKTzUWJGHcLhgrrhqOT8uD5BZJ/U8s7PYWz6eiKT5fwrb8NgMGgM Z6Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=pTeMnUqG0taa4/I2uppQoGTpaiTPrXHBggDpf9Y6gwY=; b=eDhn8EYvWqxScG/4XjOEk0OaZGFzXM08koJ6uspMs1gYUzNI6vQ5s+sGaMBl3AMWBQ 5cpj1s5sH4OAzIP2XfWZbaS1O6m7E2tz/8xBQR2hUo7mXI99+jUQwHrIx9zXYSywQN2R ONp8b/VR99Hq7LRMT/nvwScUty+l9EZsyD/TjQr+8qXuEU9qaw2jas/tKZPjLB2XdU0c gc5h/tM6tHcOOaiX2TwL98He7gf6/RK4gM4Pccg+dsTmlDgd27xStNN8J32qkLuYzna7 vxeUOS3tAqUtw4b+dHUX/47MkuMfDHpMFmEukP9pqbPfmRj4mdO65jz1htCFLspbqB3d EBEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=etmUILOF; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si4461236edr.457.2021.04.01.11.07.16; Thu, 01 Apr 2021 11:07:38 -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=@kernel.org header.s=k20201202 header.b=etmUILOF; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238294AbhDASGA (ORCPT + 99 others); Thu, 1 Apr 2021 14:06:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:48904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236997AbhDARuA (ORCPT ); Thu, 1 Apr 2021 13:50:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA71A611EE; Thu, 1 Apr 2021 12:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617281956; bh=3TI1EuLRPuxW83T74of5le/iuIR7ZM+AAKpIDXUTGuY=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=etmUILOFF6pESIgyelf63J4doWIyp0lXP4ajOwTZGn3ySiwdu0jDMFMUgsFxpBXmm GLdEW2/7CQ/CqLVNDktPs2HRqo4A+A/tJNHCs2F0Bs/CV9F++uM+Zw8OtO4VPU4GLM LhAFtQbIO5X4aQC+WWSsVaIs7LVhMwubBd77272T7utGqgbaNBZVL6K8O3plI6FSFe 2/utx2hrMPBI/ZbJgs5fk5pDJpXD+gJ/r5FwP/H5pXPMy/cYDNwY2QH1Ynq2AIuEp9 pYPKb+nx8M6VWEEy3t4G/SiyYX1V8parXtUgxu1ogAcTRFBw6LCapgC0O/9s/VaX+y KDuD0VCyyxGDw== Received: by mail-ot1-f46.google.com with SMTP id v24-20020a9d69d80000b02901b9aec33371so2043859oto.2; Thu, 01 Apr 2021 05:59:15 -0700 (PDT) X-Gm-Message-State: AOAM530hH2umoVi6kCWLthNAttmIbf7OpmiH3XvDOmh4Om6njWV5H7MX cOdvv0KVGP5iCfPsKNBM0KY18HWv+1SWarZJzNk= X-Received: by 2002:a9d:7854:: with SMTP id c20mr7182988otm.114.1617281955108; Thu, 01 Apr 2021 05:59:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:5ed4:0:0:0:0:0 with HTTP; Thu, 1 Apr 2021 05:59:14 -0700 (PDT) In-Reply-To: References: <20210401113933.GA2828895@LEGION> <20210401115008.GS2088@kadam> From: Namjae Jeon Date: Thu, 1 Apr 2021 21:59:14 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Linux-cifsd-devel] [PATCH] cifsd: use kfree to free memory allocated by kzalloc To: Ralph Boehme Cc: Dan Carpenter , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2021-04-01 21:50 GMT+09:00, Ralph Boehme : > 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 > "cifs" to "smb" ? This is not the 90's... :) It is also used with the name "ksmbd". So function and variable prefix are used with ksmbd. Thanks! > > Cheers! > -slow > >