Re: [PATCH net v3 10/14] net: pse-pd: keep the PI data until the PI regulators are gone
From: Kory Maincent
Date: Wed Nov 04 2026 - 10:39:45 EST
On Tue, 03 Nov 2026 23:02:13 +0100, Carlo Szelinsky <github@xxxxxxxxxxxx> wrote:
> pse_controller_unregister() frees the PI array, but the PI regulators
> are only unregistered after it, by devres. Until then their ops still
> run, for example on a read of the regulator's sysfs "state" or when a
> consumer enables or disables the PI, and they read the freed array.
>
> Free the PI array from a devm action that is added before the PI
> regulators, so devres frees it after them. This also frees it when
> registration fails, where it was leaked before.
>
> [...]
Reviewed-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com