Patch "soc: atmel: fix device_node release in atmel_soc_device_init()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    soc: atmel: fix device_node release in atmel_soc_device_init()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     soc-atmel-fix-device_node-release-in-atmel_soc_devic.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bbc05a60f5781ebf28b3e5a4d3de62f2fdbe2a94
Author: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
Date:   Thu Oct 31 13:33:36 2024 +0100

    soc: atmel: fix device_node release in atmel_soc_device_init()
    
    [ Upstream commit d3455ab798100f40af77123e7c2443ec979c546b ]
    
    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: 960ddf70cc11 ("drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs")
    Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20241031-soc-atmel-soc-cleanup-v2-1-73f2d235fd98@xxxxxxxxx
    Signed-off-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c
index 9e3d370114474..31fae363a589b 100644
--- a/drivers/soc/atmel/soc.c
+++ b/drivers/soc/atmel/soc.c
@@ -364,7 +364,7 @@ static const struct of_device_id at91_soc_allowed_list[] __initconst = {
 
 static int __init atmel_soc_device_init(void)
 {
-	struct device_node *np = of_find_node_by_path("/");
+	struct device_node *np __free(device_node) = of_find_node_by_path("/");
 
 	if (!of_match_node(at91_soc_allowed_list, np))
 		return 0;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux