2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/soc/atmel
Javier Carrasco d3455ab798 soc: atmel: fix device_node release in atmel_soc_device_init()
A device_node acquired via of_find_node_by_path() requires explicit
calls to of_node_put() when it is no longer needed to avoid leaking the
resource.

Instead of adding the missing calls to of_node_put() in all execution
paths, use the cleanup attribute for 'np' by means of the __free()
macro, which automatically calls of_node_put() when the variable goes
out of scope.

Fixes: 960ddf70cc ("drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241031-soc-atmel-soc-cleanup-v2-1-73f2d235fd98@gmail.com
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
2024-12-08 17:32:14 +02:00
..
Kconfig soc: at91: Add Atmel SFR SN (Serial Number) support 2019-11-07 22:33:10 +01:00
Makefile soc: at91: Add Atmel SFR SN (Serial Number) support 2019-11-07 22:33:10 +01:00
sfr.c soc: microchip: Explicitly include correct DT includes 2023-07-29 16:54:29 +03:00
soc.c soc: atmel: fix device_node release in atmel_soc_device_init() 2024-12-08 17:32:14 +02:00
soc.h ARM: at91: add support in SoC driver for new sam9x7 2024-08-07 19:24:46 +03:00