Patch "leds: lm3692x: Put fwnode in any case during ->probe()" has been added to the 5.13-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: lm3692x: Put fwnode in any case during ->probe()

to the 5.13-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-lm3692x-put-fwnode-in-any-case-during-probe.patch
and it can be found in the queue-5.13 subdirectory.

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



commit 955c3c0d1c5a73f435e3cdbac47a01d40dda8b3c
Author: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
Date:   Mon May 10 12:50:35 2021 +0300

    leds: lm3692x: Put fwnode in any case during ->probe()
    
    [ Upstream commit f55db1c7fadc2a29c9fa4ff3aec98dbb111f2206 ]
    
    device_get_next_child_node() bumps a reference counting of a returned variable.
    We have to balance it whenever we return to the caller.
    
    Fixes: 9a5c1c64ac0a ("leds: lm3692x: Change DT calls to fwnode calls")
    Cc: Dan Murphy <dmurphy@xxxxxx>
    Signed-off-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
    Signed-off-by: Pavel Machek <pavel@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c
index e945de45388c..55e6443997ec 100644
--- a/drivers/leds/leds-lm3692x.c
+++ b/drivers/leds/leds-lm3692x.c
@@ -435,6 +435,7 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
 
 	ret = fwnode_property_read_u32(child, "reg", &led->led_enable);
 	if (ret) {
+		fwnode_handle_put(child);
 		dev_err(&led->client->dev, "reg DT property missing\n");
 		return ret;
 	}
@@ -449,12 +450,11 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
 
 	ret = devm_led_classdev_register_ext(&led->client->dev, &led->led_dev,
 					     &init_data);
-	if (ret) {
+	if (ret)
 		dev_err(&led->client->dev, "led register err: %d\n", ret);
-		return ret;
-	}
 
-	return 0;
+	fwnode_handle_put(init_data.fwnode);
+	return ret;
 }
 
 static int lm3692x_probe(struct i2c_client *client,



[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