From: Wangyunjian <wangyunjian@huawei.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "matan@nvidia.com" <matan@nvidia.com>,
"suanmingm@nvidia.com" <suanmingm@nvidia.com>,
"Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"dsosnowski@nvidia.com" <dsosnowski@nvidia.com>,
"viacheslavo@nvidia.com" <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>,
"orika@nvidia.com" <orika@nvidia.com>,
"rasland@nvidia.com" <rasland@nvidia.com>
Subject: RE: [PATCH v2] net/mlx5: fix memoy leak after device spawn failure
Date: Thu, 5 Feb 2026 01:56:09 +0000 [thread overview]
Message-ID: <3a252aace4b640689122e2c03b102679@huawei.com> (raw)
In-Reply-To: <1766055446-41476-1-git-send-email-wangyunjian@huawei.com>
Friendly ping
> -----Original Message-----
> From: Wangyunjian <wangyunjian@huawei.com>
> Sent: Thursday, December 18, 2025 6:57 PM
> To: dev@dpdk.org
> Cc: matan@nvidia.com; suanmingm@nvidia.com; Lilijun (Jerry)
> <jerry.lilijun@huawei.com>; Wangyunjian <wangyunjian@huawei.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix memoy leak after device spawn failure
>
> In mlx5_dev_spawn() allocated memory for the 'priv->flows', we should free it
> when errors occur, otherwise it will lead to memory leak.
>
> Fixes: b4edeaf3efd5 ("net/mlx5: replace flow list with indexed pool")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> v2: fix code styles
> ---
> drivers/net/mlx5/linux/mlx5_os.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
> index 7f73183bb1..7624b2aba2 100644
> --- a/drivers/net/mlx5/linux/mlx5_os.c
> +++ b/drivers/net/mlx5/linux/mlx5_os.c
> @@ -1831,6 +1831,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
> close(priv->nl_socket_route);
> if (priv->vmwa_context)
> mlx5_vlan_vmwa_exit(priv->vmwa_context);
> + for (i = 0; i < MLX5_FLOW_TYPE_MAXI; i++) {
> + if (!priv->flows[i])
> + continue;
> + mlx5_ipool_destroy(priv->flows[i]);
> + }
> if (eth_dev && priv->drop_queue.hrxq)
> mlx5_drop_action_destroy(eth_dev);
> if (priv->mtr_profile_tbl)
> --
> 2.33.0
next prev parent reply other threads:[~2026-02-05 1:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 9:31 [PATCH 1/1] net/mlx5: fix memoy leak after device spawn failure Yunjian Wang
2025-12-18 10:57 ` [PATCH v2] " Yunjian Wang
2026-02-05 1:56 ` Wangyunjian [this message]
2026-02-08 13:27 ` Raslan Darawsheh
2026-02-05 9:06 ` Dariusz Sosnowski
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=3a252aace4b640689122e2c03b102679@huawei.com \
--to=wangyunjian@huawei.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=jerry.lilijun@huawei.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@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