Re: [PATCH] net: dsa: mt7530: fix regulator leak in mt7530_setup()

From: Xiangwu Lai

Date: Thu Nov 19 2026 - 01:06:12 EST


Hi Andrew,

thanks for the review. For the record, this replies to "[PATCH] net:
dsa: mt7530: fix regulator leak in mt7530_setup()":

https://lore.kernel.org/all/20261118014114.1855-1-laixiangwu@xxxxxxxxxxxxxxxxxxxx/

On Thu, Nov 19, 2026 at 12:36:27AM +0100, Andrew Lunn wrote:
> > Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
>
> Does this bother anybody?
>
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

The quoted subject is the exact title the commit has in mainline: the
"net-next: " prefix is part of the commit subject itself, Sean Wang's
2017 patch went in with the list prefix kept in the subject, and
"git log --format=%s b8f126a8d543" prints it that way. I kept the
tag verbatim so that it matches the tree, which is what the stable
rules ask for. There is nothing to change on my side here unless the
stable maintainers say otherwise.

> It is unusual to have two different goto labels with return. Normally
> cleanup is structured similar to the code which went wrong.
>
> So something like:
>
> > +err_powers:
> > + if (priv->id == ID_MT7530)
> > + regulator_disable(priv->io_pwr);
> > +err_disable_core_pwr:
> > + if (priv->id == ID_MT7530)
> > + regulator_disable(priv->core_pwr);
> > + return ret;

Agreed, that is the better structure. v2 follows as a new thread
with exactly this fall-through cleanup and a Suggested-by: tag for
you:

https://lore.kernel.org/all/20261119060424.1476-1-laixiangwu@xxxxxxxxxxxxxxxxxxxx/

Best regards,
Xiangwu Lai