> -----Original Message-----
> From: dev <[email protected]> On Behalf Of
> [email protected]
> Sent: Saturday, August 21, 2021 4:14 PM
> To: [email protected]
> Cc: Xing, Beilei <[email protected]>; Qiming Chen
> <[email protected]>; [email protected]
> Subject: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem
>
> From: Qiming Chen <[email protected]>
>
> In the i40evf_dev_init function, when the MAC memory alloc fails, the
> previously initialized vf resource is not released, resulting in leakage.
> The patch calls the i40evf_uninit_vf function in the abnormal branch to
> release
> resources.
>
> Fixes: 5c9222058df7 ("i40e: move to drivers/net/")
> Cc: [email protected]
>
> Signed-off-by: Qiming Chen <[email protected]>
> ---
> drivers/net/i40e/i40e_ethdev_vf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 003d41373b..f64db72e9a 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1622,6 +1622,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
> PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to"
> " store MAC addresses",
> RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX);
> + (void)i40evf_uninit_vf(eth_dev);
> return -ENOMEM;
> }
> rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr,
> --
> 2.30.1.windows.1
The patch is not applied for main repo as i40evf will be removed, you can
submit a fix to dpdk-stable directly.