Re: [PATCH net] net: xgene: fix mdio_np leak in xgene_mdiobus_register()

From: Simon Horman

Date: Sun May 10 2026 - 14:43:04 EST


On Sun, May 10, 2026 at 07:41:27PM +0100, Simon Horman wrote:
> On Thu, May 07, 2026 at 07:50:24PM +0530, Shitalkumar Gandhi wrote:
> > The for_each_child_of_node() loop captures mdio_np via break,
> > holding the refcount. of_mdiobus_register() does not consume the
> > reference, so it leaks on success.
> >
> > Put it after registration.
> >
> > Fixes: e6ad767305eb ("drivers: net: Add APM X-Gene SoC ethernet driver support.")
> > Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@xxxxxxxxxxxxxxxxxxx>
>
> Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
>
> FTR: There is an AI-generated review of this patch which you may
> want to look at for possible follow-up. I do not believe it
> should block progress of this patch.

I meant to mention that the AI-generated review I'm referring
to is available on sashiko.dev.