Re: [PATCH] thermal/of: fix device node refcount leak in thermal_of_cm_lookup()

From: Markus Elfring

Date: Sat Jan 17 2026 - 11:21:03 EST



> Add the missing of_node_put() calls on all paths to prevent the

How do you think about to use an attribute like “__free(device_node)” instead?
https://elixir.bootlin.com/linux/v6.19-rc5/source/include/linux/of.h#L138
https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/thermal/thermal_of.c#L277-L303


Was such an improvable implementation detail detected by any known source code
analysis approaches?


> reference count leak.

Would you like to use this term also in the summary phrase?

Regards,
Markus