linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: pca963x: Add missing initialiation of struct led_info.flags
@ 2015-03-15 10:41 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2015-03-15 10:41 UTC (permalink / raw)
  To: Bryan Wu, Richard Purdie; +Cc: linux-leds, linux-kernel, Geert Uytterhoeven

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.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/leds/leds-pca963x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c
index f110b4c456baa77f..bee3e1ab27fd92fd 100644
--- a/drivers/leds/leds-pca963x.c
+++ b/drivers/leds/leds-pca963x.c
@@ -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;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-15 10:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-15 10:41 [PATCH] leds: pca963x: Add missing initialiation of struct led_info.flags Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).