From: Leon Romanovsky <leon@kernel.org>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: kjlu@umn.edu, Saeed Mahameed <saeedm@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/mlx5e: Fix two double free cases
Date: Sun, 27 Dec 2020 10:40:01 +0200 [thread overview]
Message-ID: <20201227084001.GF4457@unreal> (raw)
In-Reply-To: <20201221085031.6591-1-dinghao.liu@zju.edu.cn>
On Mon, Dec 21, 2020 at 04:50:31PM +0800, Dinghao Liu wrote:
> mlx5e_create_ttc_table_groups() frees ft->g on failure of
> kvzalloc(), but such failure will be caught by its caller
> in mlx5e_create_ttc_table() and ft->g will be freed again
> in mlx5e_destroy_flow_table(). The same issue also occurs
> in mlx5e_create_ttc_table_groups().
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
I'm not thrilled to see release in the error flow that will be done in
the different function. The missing piece is "ft->g = NULL" after kfree().
And also fixes lines are missing in all your patches.
Thanks
next prev parent reply other threads:[~2020-12-27 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 8:50 [PATCH] net/mlx5e: Fix two double free cases Dinghao Liu
2020-12-27 8:40 ` Leon Romanovsky [this message]
2020-12-28 3:14 ` dinghao.liu
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=20201227084001.GF4457@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=dinghao.liu@zju.edu.cn \
--cc=kjlu@umn.edu \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.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