Re: [PATCH net-next v6 4/7] net: stmmac: introduce pcs_init/pcs_exit stmmac operations

From: Romain Gantois
Date: Mon May 13 2024 - 03:27:16 EST


Hello Simon,

On Sat, 11 May 2024, Simon Horman wrote:

> > - if (priv->plat->mdio_bus_data && priv->plat->mdio_bus_data->has_xpcs) {
> > + if (priv->plat->pcs_init) {
> > + ret = priv->plat->pcs_init(priv);
> > + } else if (priv->plat->mdio_bus_data &&
> > + priv->plat->mdio_bus_data->has_xpcs) {
> > /* Try to probe the XPCS by scanning all addresses */
> > for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
> > xpcs = xpcs_create_mdiodev(priv->mii, addr, mode);
>
> I am unsure if this can occur, but if priv->plat->pcs_init returns 0 then
> xpcs will be used while uninitialised towards the end of this function.

Indeed this could occur, I've just sent a v7 that fixes this.

Thanks,

--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com