From: Eric Dumazet <eric.dumazet@gmail.com>
To: Denis Efremov <efremov@linux.com>, Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leon@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/mlx5: Use kfree(ft->g) in arfs_create_groups()
Date: Fri, 5 Jun 2020 12:57:14 -0700 [thread overview]
Message-ID: <1cd5f60d-4a42-f7ba-1d0b-2303470a1f73@gmail.com> (raw)
In-Reply-To: <20200605192235.79241-1-efremov@linux.com>
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 ?
next prev parent reply other threads:[~2020-06-05 19:57 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 [this message]
2020-06-11 22:08 ` Saeed Mahameed
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=1cd5f60d-4a42-f7ba-1d0b-2303470a1f73@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=efremov@linux.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
/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