Skip to contentSkip to conversation

leds: pca963x: Add missing initialiation of struct led_info.flags

PATCH New Geert Uytterhoeven 1 participant 1 message Mar 15, 2015 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: pca963x: Add missing initialiation of struct led_info.flags

drivers/leds/leds-pca963x.c: In function ‘pca963x_dt_init’:
drivers/leds/leds-pca963x.c:303: warning: ‘led.flags’ is used uninitialized in this function

Only the name and default_trigger fields are initialized. Other fields (currently flags only) contain random stack data. Pre-initialize the led structure completely to fix this.

---
 drivers/leds/leds-pca963x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-pca963x.c +1 -1
index f110b4c456baa77f..bee3e1ab27fd92fd 100644
@@ -289,7 +289,7 @@ pca963x_dt_init(struct i2c_client *client, struct pca963x_chipdef *chip)
 		return ERR_PTR(-ENOMEM);
 
 	for_each_child_of_node(np, child) {
-		struct led_info led;
+		struct led_info led = {};
 		u32 reg;
 		int res;
 
Signature · 1 line
1.9.1