Patch "leds: max5970: Fix unreleased fwnode_handle in probe function" has been added to the 6.11-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

    leds: max5970: Fix unreleased fwnode_handle in probe function

to the 6.11-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:
     leds-max5970-fix-unreleased-fwnode_handle-in-probe-f.patch
and it can be found in the queue-6.11 subdirectory.

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



commit 92e8a9eff9ea169984abb1606dad2e8fdf7bbcdf
Author: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
Date:   Thu Oct 31 17:30:30 2024 +0100

    leds: max5970: Fix unreleased fwnode_handle in probe function
    
    [ Upstream commit 02f58f97419c828f58e30f24f54395ac9be159c0 ]
    
    An object initialized via device_get_named_child_node() requires calls
    to fwnode_handle_put() when it is no longer required to avoid leaking
    memory.
    
    Add the automatic cleanup facility for 'led_node' to ensure that
    fwnode_handle_put() is called in all execution paths.
    
    Fixes: 736214b4b02a ("leds: max5970: Add support for max5970")
    Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20241031-max5970-of_node_put-v2-1-0ffe1f1d3bc9@xxxxxxxxx
    Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/leds-max5970.c b/drivers/leds/leds-max5970.c
index 56a584311581a..285074c53b234 100644
--- a/drivers/leds/leds-max5970.c
+++ b/drivers/leds/leds-max5970.c
@@ -45,7 +45,7 @@ static int max5970_led_set_brightness(struct led_classdev *cdev,
 
 static int max5970_led_probe(struct platform_device *pdev)
 {
-	struct fwnode_handle *led_node, *child;
+	struct fwnode_handle *child;
 	struct device *dev = &pdev->dev;
 	struct regmap *regmap;
 	struct max5970_led *ddata;
@@ -55,7 +55,8 @@ static int max5970_led_probe(struct platform_device *pdev)
 	if (!regmap)
 		return -ENODEV;
 
-	led_node = device_get_named_child_node(dev->parent, "leds");
+	struct fwnode_handle *led_node __free(fwnode_handle) =
+		device_get_named_child_node(dev->parent, "leds");
 	if (!led_node)
 		return -ENODEV;
 




[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