Patch "leds: tca6507: Fix error handling of using fwnode_property_read_string" 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

    leds: tca6507: Fix error handling of using fwnode_property_read_string

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:
     leds-tca6507-fix-error-handling-of-using-fwnode_prop.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 402b7a423eb731da1f03f88141cba7f9d7b60b43
Author: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
Date:   Sun Apr 2 13:12:59 2023 +0200

    leds: tca6507: Fix error handling of using fwnode_property_read_string
    
    [ Upstream commit c1087c29e96a48e9080377e168d35dcb52fb068b ]
    
    Commit 96f524105b9c ("leds: tca6507: use fwnode API instead of OF")
    
    changed to fwnode API but did not take into account that a missing property
    "linux,default-trigger" now seems to return an error and as a side effect
    sets value to -1. This seems to be different from of_get_property() which
    always returned NULL in any case of error.
    
    Neglecting this side-effect leads to
    
    [   11.201965] Unable to handle kernel paging request at virtual address ffffffff when read
    
    in the strcmp() of led_trigger_set_default() if there is no led-trigger
    defined in the DTS.
    
    I don't know if this was recently introduced somewhere in the fwnode lib
    or if the effect was missed in initial testing. Anyways it seems to be a
    bug to ignore the error return value of an optional value here in the
    driver.
    
    Fixes: 96f524105b9c ("leds: tca6507: use fwnode API instead of OF")
    Signed-off-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
    Acked-by: Pavel Machek <pavel@xxxxxx>
    Reviewed-by: Marek Behún <kabel@xxxxxxxxxx>
    Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/cbae7617db83113de726fcc423a805ebaa1bfca6.1680433978.git.hns@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index 225b765830bdc..caad9d3e0eac8 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -696,8 +696,9 @@ tca6507_led_dt_init(struct device *dev)
 		if (fwnode_property_read_string(child, "label", &led.name))
 			led.name = fwnode_get_name(child);
 
-		fwnode_property_read_string(child, "linux,default-trigger",
-					    &led.default_trigger);
+		if (fwnode_property_read_string(child, "linux,default-trigger",
+						&led.default_trigger))
+			led.default_trigger = NULL;
 
 		led.flags = 0;
 		if (fwnode_property_match_string(child, "compatible",



[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