From db43d2c4c11e53b582ffc16eff6263855794dcb8 Mon Sep 17 00:00:00 2001 From: Jilay Pandya Date: Sat, 7 Dec 2024 10:17:51 +0100 Subject: [PATCH] drivers: led: is31fl3194.c fix uninitialized scalar variable in the switch case in the preceeding for loop if default path is taken all the time, then the ret variable will stay uninitialized, the original contributor of this driver has provided a comment that this path shall never be reached, however, it is better to return an error code instead of continuing with an incorrect configuration, hence this commit replaces continue with a proper return errno. Signed-off-by: Jilay Pandya --- drivers/led/is31fl3194.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/led/is31fl3194.c b/drivers/led/is31fl3194.c index 98f1de410d2..649afa5556a 100644 --- a/drivers/led/is31fl3194.c +++ b/drivers/led/is31fl3194.c @@ -109,7 +109,7 @@ static int is31fl3194_set_color(const struct device *dev, uint32_t led, uint8_t break; default: /* unreachable: mapping already tested in is31fl3194_check_config */ - continue; + return -EINVAL; } ret = i2c_reg_write_byte_dt(&config->bus, led_channels[i], value);