linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Muhammad Usama Anjum <musamaanjum@gmail.com>
Cc: Namjae Jeon <namjae.jeon@samsung.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steve French <sfrench@samba.org>,
	Hyunchul Lee <hyc.lee@gmail.com>,
	open list: COMMON INTERNET FILE SYSTEM SERVER 
	<linux-cifs@vger.kernel.org>,
	COMMON INTERNET FILE SYSTEM SERVER 
	<linux-cifsd-devel@lists.sourceforge.net>,
	open list <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, colin.king@canonical.com, ;
Subject: Re: [PATCH] cifsd: use kfree to free memory allocated by kzalloc
Date: Thu, 1 Apr 2021 14:50:08 +0300	[thread overview]
Message-ID: <20210401115008.GS2088@kadam> (raw)
In-Reply-To: <20210401113933.GA2828895@LEGION>

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.

I think that cifsd is being re-written though so it might not be worth
it.

regards,
dan carpenter

  reply	other threads:[~2021-04-01 17:57 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 [this message]
2021-04-01 12:43   ` [Linux-cifsd-devel] " Namjae Jeon
2021-04-01 12:50     ` Ralph Boehme
2021-04-01 12:59       ` Namjae Jeon
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=20210401115008.GS2088@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=colin.king@canonical.com \
    --cc=hyc.lee@gmail.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=namjae.jeon@samsung.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sfrench@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).