Re: [PATCH] interconnect: imx: fix use-after-free in imx_icc_node_init_qos()

From: Markus Elfring

Date: Wed Apr 08 2026 - 03:36:06 EST


> Move of_node_put(dn) after the last use of dn, and add a missing put
> in the error path to avoid both use-after-free and reference leak.

How do you think about to increase the application of scope-based resource management?
https://elixir.bootlin.com/linux/v7.0-rc7/source/include/linux/of.h#L138
https://elixir.bootlin.com/linux/v7.0-rc7/source/drivers/interconnect/imx/imx.c#L117-L160

Regards,
Markus