Re: [PATCH net-next 2/4] net: pse-pd: unwind allocations when controller registration fails

From: Carlo Szelinsky

Date: Mon Oct 19 2026 - 16:01:40 EST


On Mon, 19 Oct 2026 08:35:37 +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> [Severity: Medium]
> Do these goto free_kfifo paths leak the OF node references held in
> pcdev->pi[]?

Yes, and the commit message is wrong about that. The regulator core
takes its own reference on the PI node, so I will drop the references
on these paths and keep only the array. That goes into the next
version, in net.

> [Severity: Medium]
> This recheck covers pse_pi_update_pw_budget() itself. Doesn't
> pse_ethtool_set_pw_limit() still read pw_d and the PI state without
> pcdev->lock before it calls this function?

Yes. That is fixed in net by "net: pse-pd: check the PI state under
the lock when setting a power limit".

> [Severity: Low]
> Should this patch carry a Fixes: tag

Yes. The patch moves to net, where it gets Fixes tags.

> [Severity: High]
> This is a pre-existing issue, but it sits next to this teardown code.
> devm_pse_alloc_pw_d() still allocates the power domain against the
> controller that creates it

Older bug, fixed in net by "net: pse-pd: do not tie a shared power
domain to its creator's devres".

> [Severity: High]
> This is a pre-existing issue, but does the normal unregister path follow
> the rule in this comment?

No, an older bug. The PI regulator part is fixed by the second patch
of [1], which I will rework and fold into the net series. Ethtool
callers that still hold a handle are fixed by the PSE notifier series.

> [Severity: Medium]
> This is a pre-existing issue, but none of the error paths after a
> successful setup_pi_matrix() undo what the driver did in that callback.

Only pd692x0 leaves something behind there: its power budget. That is
fixed in net by "net: pse-pd: pd692x0: release the manager power
budget through devres". The other drivers only read the device tree
and write registers there, so nothing is left to undo.

[1] https://lore.kernel.org/netdev/20260813200653.980170-1-github@xxxxxxxxxxxx/

Carlo