Skip to content

Commit 6cbf5c9

Browse files
SurajSonawane2415lag-linaro
authored andcommitted
leds: rgb: leds-mt6370-rgb: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear to resolve the following warning: drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear() error: uninitialized symbol 'ret'. Initialize 'ret' to 0 to prevent undefined behavior from uninitialized access. Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com> Link: https://lore.kernel.org/r/20241016042142.8088-1-surajsonawane0215@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 681d5fa commit 6cbf5c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/leds/rgb/leds-mt6370-rgb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
587587
struct mt6370_led *led = container_of(mccdev, struct mt6370_led, mc);
588588
struct mt6370_priv *priv = led->priv;
589589
struct mc_subled *subled;
590-
int i, ret;
590+
int i, ret = 0;
591591

592592
mutex_lock(&led->priv->lock);
593593

0 commit comments

Comments
 (0)