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 <jilay.pandya@outlook.com>
This commit is contained in:
parent
23b6ab4699
commit
db43d2c4c1
1 changed files with 1 additions and 1 deletions
|
|
@ -109,7 +109,7 @@ static int is31fl3194_set_color(const struct device *dev, uint32_t led, uint8_t
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unreachable: mapping already tested in is31fl3194_check_config */
|
/* unreachable: mapping already tested in is31fl3194_check_config */
|
||||||
continue;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = i2c_reg_write_byte_dt(&config->bus, led_channels[i], value);
|
ret = i2c_reg_write_byte_dt(&config->bus, led_channels[i], value);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue