From: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx> commit 147359e23e5c9652ff8c5a98a51a7323bd51c94a upstream. Device nodes accessed via of_get_compatible_child() require of_node_put() to be called when the node is no longer required to avoid leaving a reference to the node behind, leaking the resource. In this case, the usage of 'tnode' is straightforward and there are no error paths, allowing for a single of_node_put() when 'tnode' is no longer required. Cc: stable@xxxxxxxxxxxxxxx Fixes: 29646ee33cc3 ("counter: stm32-timer-cnt: add checks on quadrature encoder capability") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx> Link: https://lore.kernel.org/r/20241027-stm32-timer-cnt-of_node_put-v1-1-ebd903cdf7ac@xxxxxxxxx Signed-off-by: William Breathitt Gray <wbg@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/counter/stm32-timer-cnt.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/counter/stm32-timer-cnt.c +++ b/drivers/counter/stm32-timer-cnt.c @@ -700,6 +700,7 @@ static int stm32_timer_cnt_probe_encoder } ret = of_property_read_u32(tnode, "reg", &idx); + of_node_put(tnode); if (ret) { dev_err(dev, "Can't get index (%d)\n", ret); return ret; Patches currently in stable-queue which might be from javier.carrasco.cruz@xxxxxxxxx are queue-6.12/leds-max5970-fix-unreleased-fwnode_handle-in-probe-f.patch queue-6.12/wifi-brcmfmac-release-root-node-in-all-execution-paths.patch queue-6.12/counter-stm32-timer-cnt-fix-device_node-handling-in-probe_encoder.patch queue-6.12/staging-vchiq_arm-fix-missing-refcount-decrement-in-error-path-for-fw_node.patch queue-6.12/bluetooth-btbcm-fix-missing-of_node_put-in-btbcm_get.patch queue-6.12/platform-chrome-cros_ec_typec-fix-missing-fwnode-reference-decrement.patch queue-6.12/clocksource-drivers-timer-ti-dm-fix-child-node-refco.patch queue-6.12/mtd-ubi-fix-unreleased-fwnode_handle-in-find_volume_fwnode.patch queue-6.12/soc-fsl-rcpm-fix-missing-of_node_put-in-copy_ippdexpcr1_setting.patch