Commit 49ad0689 authored by Javier Carrasco's avatar Javier Carrasco Committed by Greg Kroah-Hartman
Browse files

soc: atmel: fix device_node release in atmel_soc_device_init()



[ Upstream commit d3455ab7 ]

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: 960ddf70 ("drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs")
Signed-off-by: default avatarJavier 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: default avatarClaudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 208e102a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment