From: Saeed Mahameed <saeedm@mellanox.com>
To: "efremov@linux.com" <efremov@linux.com>,
"eric.dumazet@gmail.com" <eric.dumazet@gmail.com>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"leon@kernel.org" <leon@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net/mlx5: Use kfree(ft->g) in arfs_create_groups()
Date: Thu, 11 Jun 2020 22:08:50 +0000 [thread overview]
Message-ID: <6e00918130708cdc8eb6cbf77333ef92567675bc.camel@mellanox.com> (raw)
In-Reply-To: <1cd5f60d-4a42-f7ba-1d0b-2303470a1f73@gmail.com>
On Fri, 2020-06-05 at 12:57 -0700, Eric Dumazet wrote:
>
> On 6/5/20 12:22 PM, Denis Efremov wrote:
> > Use kfree() instead of kvfree() on ft->g in arfs_create_groups()
> > because
> > the memory is allocated with kcalloc().
> >
> > Signed-off-by: Denis Efremov <efremov@linux.com>
> > ---
> > drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > index 014639ea06e3..c4c9d6cda7e6 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > @@ -220,7 +220,7 @@ static int arfs_create_groups(struct
> > mlx5e_flow_table *ft,
> > sizeof(*ft->g), GFP_KERNEL);
> > in = kvzalloc(inlen, GFP_KERNEL);
> > if (!in || !ft->g) {
> > - kvfree(ft->g);
> > + kfree(ft->g);
> > kvfree(in);
> > return -ENOMEM;
> > }
> >
>
> This is slow path, kvfree() is perfectly able to free memory that was
> kmalloc()ed
>
> net-next is closed, can we avoid these patches during merge window ?
I agree, with Eric, better if we wait for net-next to open.
I will apply this once net-next is open.
Thanks,
Saeed.
prev parent reply other threads:[~2020-06-11 22:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-05 19:22 [PATCH] net/mlx5: Use kfree(ft->g) in arfs_create_groups() Denis Efremov
2020-06-05 19:57 ` Eric Dumazet
2020-06-11 22:08 ` Saeed Mahameed [this message]
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=6e00918130708cdc8eb6cbf77333ef92567675bc.camel@mellanox.com \
--to=saeedm@mellanox.com \
--cc=efremov@linux.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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