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

From: Xiangwu Lai

Date: Thu Nov 19 2026 - 01:07:50 EST


Hi,

On Wed, Nov 18, 2026 at 01:42:16AM +0000, netdev-bot+sinfo@xxxxxxxxxx wrote:
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
>
> - Whether the issue was actually triggered, or is only theoretical
> (e.g. found by LLM and not proven at runtime). If it was triggered
> please include the symptoms, like the stack trace or kernel
> messages.

Please find the information below, for the patch "[PATCH] net: dsa:
mt7530: fix regulator leak in mt7530_setup()":

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

How the issue was discovered: manual code inspection of the error
paths of mt7530_setup(), while auditing DSA drivers for probe-time
resource leaks. No scanner or LLM was involved.

Whether the issue was actually triggered: no, it is theoretical. The
leak needs mt7530_setup() to fail after the two regulators have been
enabled (reset timeout, unsupported chip ID, 20MHz XTAL, VLAN setup,
PHY muxing, GPIO setup or FDB flush failure), which does not happen on
a working system. If it did happen, the symptom would be both the
core and io supplies of the switch staying powered after the failed
probe, and a WARN_ON(enable_count) splat from the regulator core when
the devm-acquired regulator handles are released with a nonzero
enable count. No such report is known to me.

Hardware the change was tested on: none, the patch was not tested on
real hardware. The change only routes existing failure branches to
two new error labels calling regulator_disable(), mirroring what
mt7530_remove() already does on the removal path, so the behaviour on
a successful probe is unchanged.

The series is respun as v2 to address the review feedback received on
the list, and the same information is folded into the v2 commit
message:

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

Best regards,
Xiangwu Lai