Re: [PATCH net v2 08/14] net: pse-pd: stop async event sources before freeing PI data in unregister
From: Oleksij Rempel
Date: Thu Oct 22 2026 - 01:21:07 EST
On Tue, Oct 20, 2026 at 07:12:43PM +0200, Carlo Szelinsky wrote:
> pse_controller_unregister() flushes the power domains and frees the PI
> array before it disables the IRQ, while pse_isr() uses both. No in-tree
> driver hits this: tps23881, the only user of devm_pse_irq_helper(),
> requests its IRQ after it registers the controller, so devres frees
> the IRQ before unregister runs. A driver that keeps its IRQ across
> unregister would read freed memory.
>
> Disable the IRQ and drain the notification worker first, and only then
> flush the power domains and release the PI array. The next patches in
> this series build on this order.
>
> Found by code inspection. Not reproduced.
>
> Reviewed-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>
> Signed-off-by: Carlo Szelinsky <github@xxxxxxxxxxxx>
Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Thank you!
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |