Hi stable folks,
Please apply commit ccc35ff2fd29 ("leds: spi-byte: Use devm_led_classdev_register_ext()") to 5.15, 6.1, and 6.6. It inadvertently addresses an instance of -Wuninitialized visible with clang-21 and newer:
drivers/leds/leds-spi-byte.c:99:26: error: variable 'child' is uninitialized when used here [-Werror,-Wuninitialized] 99 | of_property_read_string(child, "label", &name); | ^~~~~ drivers/leds/leds-spi-byte.c:83:27: note: initialize the variable 'child' to silence this warning 83 | struct device_node *child; | ^ | = NULL
It applies cleanly to 6.6. I have attached a backport for 6.1 and 5.15, which can be generated locally with:
$ git format-patch -1 --stdout ccc35ff2fd2911986b716a87fe65e03fac2312c9 | sed 's;strscpy;strlcpy;' | patch -p1
This change seems safe to me but if I am missing a massive dependency chain, an alternative would be moving child's initialization up in these stable branches.
Cheers, Nathan
diff --git a/drivers/leds/leds-spi-byte.c b/drivers/leds/leds-spi-byte.c index 82696e0607a5..7dd876df8b36 100644 --- a/drivers/leds/leds-spi-byte.c +++ b/drivers/leds/leds-spi-byte.c @@ -96,6 +96,7 @@ static int spi_byte_probe(struct spi_device *spi) if (!led) return -ENOMEM;
+ child = of_get_next_available_child(dev_of_node(dev), NULL); of_property_read_string(child, "label", &name); strlcpy(led->name, name, sizeof(led->name)); led->spi = spi; @@ -106,7 +107,6 @@ static int spi_byte_probe(struct spi_device *spi) led->ldev.max_brightness = led->cdef->max_value - led->cdef->off_value; led->ldev.brightness_set_blocking = spi_byte_brightness_set_blocking;
- child = of_get_next_available_child(dev_of_node(dev), NULL); state = of_get_property(child, "default-state", NULL); if (state) { if (!strcmp(state, "on")) {