linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: Ralph Boehme <slow@samba.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	COMMON INTERNET FILE SYSTEM SERVER  <linux-cifs@vger.kernel.org>,
	COMMON INTERNET FILE SYSTEM SERVER 
	<linux-cifsd-devel@lists.sourceforge.net>,
	kernel-janitors@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>,
	Steve French <sfrench@samba.org>,
	colin.king@canonical.com,
	Muhammad Usama Anjum <musamaanjum@gmail.com>
Subject: Re: [Linux-cifsd-devel] [PATCH] cifsd: use kfree to free memory allocated by kzalloc
Date: Thu, 1 Apr 2021 21:59:14 +0900	[thread overview]
Message-ID: <CAKYAXd-ScM9i9Ln_FL8pWyEnPO_0n8t1BLH8MJ=b4NkqEbhZ=Q@mail.gmail.com> (raw)
In-Reply-To: <ca1b9b0c-55f9-025d-558b-1b2b6c866d12@samba.org>

2021-04-01 21:50 GMT+09:00, Ralph Boehme <slow@samba.org>:
> Am 4/1/21 um 2:43 PM schrieb Namjae Jeon:
>> 2021-04-01 20:50 GMT+09:00, Dan Carpenter <dan.carpenter@oracle.com>:
>>> 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 <musamaanjum@gmail.com>
>>>> ---
>>>> 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
>
>

  reply	other threads:[~2021-04-01 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 11:39 [PATCH] cifsd: use kfree to free memory allocated by kzalloc Muhammad Usama Anjum
2021-04-01 11:50 ` Dan Carpenter
2021-04-01 12:43   ` [Linux-cifsd-devel] " Namjae Jeon
2021-04-01 12:50     ` Ralph Boehme
2021-04-01 12:59       ` Namjae Jeon [this message]
2021-04-01 13:14         ` Ralph Boehme
2021-04-01 13:36           ` Namjae Jeon
2021-04-01 21:04             ` Tom Talpey
2021-04-07  0:17               ` ronnie sahlberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKYAXd-ScM9i9Ln_FL8pWyEnPO_0n8t1BLH8MJ=b4NkqEbhZ=Q@mail.gmail.com' \
    --to=linkinjeon@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-cifsd-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=musamaanjum@gmail.com \
    --cc=sfrench@samba.org \
    --cc=slow@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).