> -----Original Message----- > From: David Marchand <[email protected]> > Sent: Friday, September 11, 2026 11:55 AM > To: Dariusz Sosnowski <[email protected]> > Cc: [email protected]; [email protected]; [email protected]; Slava > Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori > Kam <[email protected]>; Suanming Mou <[email protected]>; Matan > Azrad <[email protected]> > Subject: Re: [PATCH v6 5/5] net/mlx5: accept more unicast MAC addresses > > External email: Use caution opening links or attachments > > > Hello Dariusz, > > Thanks for the review. > > On Fri, 11 Sept 2026 at 11:00, Dariusz Sosnowski <[email protected]> > wrote: > > > @@ -1963,17 +1989,15 @@ mlx5_dev_spawn(struct rte_device > *dpdk_dev, > > > mlx5_flex_item_port_cleanup(eth_dev); > > > mlx5_free(priv->ext_rxqs); > > > mlx5_free(priv->ext_txqs); > > > + mlx5_free(priv->mac); > > > + eth_dev->data->mac_addrs = NULL; > > > > This can segfault because eth_dev is allocated later than priv. > > Previous version of the error rollback accounted for that (where > > mac_addrs was reset only if eth_dev != NULL). > > The same logic applies in Windows code. > > > > Could you please revert that? > > Well, the code before looked fishy to me. > Resetting mac_addrs if (eth_dev != NULL) outside of the if (priv != > NULL) block seems incorrect. > > > > > + mlx5_free(priv->mac_own); > > > mlx5_free(priv); > > > if (eth_dev != NULL) > > > eth_dev->data->dev_private = NULL; > > I would rather reset mac_addrs to NULL along the dev_private reset in the if > (eth_dev != NULL) block right after. > The comment about mac_addrs (see below) being in dev_private can also be > removed. > > WDYT?
Resetting it along with dev_private reset sounds good to me.

