Re: [PATCH net-next v3 RESEND] net: phy: nxp-tja11xx: cancel registration work on remove

From: Andrew Lunn

Date: Tue Aug 11 2026 - 17:28:51 EST


On Wed, Jul 29, 2026 at 11:53:22PM +0800, Hongyan Xu wrote:
> tja1102_p0_probe() schedules work to register the second port. That work
> uses the Port 0 private data and phydev. The private data is
> devm-allocated, but the driver does not wait for the pending work on
> remove.
>
> Store the Port 0 private data in phydev->priv and add a remove callback.
> The callback cancels the registration work before devres teardown frees
> the state.
>
> This issue was found by a static analysis tool.
>
> Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
> Signed-off-by: Hongyan Xu <getshell@xxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew