Thread (35 messages) flat view 35 messages, 15 authors, 2012-08-20
STALE5120d

[PATCH 02/11] mfd/asic3: fix asic3_mfd_probe return value

From: arnd@arndb.de (Arnd Bergmann)
Date: 2012-08-08 14:47:40
Also in: lkml
Subsystem: multifunction devices (mfd), the rest · Maintainers: Lee Jones, Linus Torvalds

In commit 4f304245b "mfd: Set asic3 DS1WM clock_rate", a possible
path through asic3_mfd_probe was introduced that would lead to
an unpredictable return value, if everything succeeds but there
are pdata->leds is NULL. This was reported correctly by gcc.

Without this patch, building magician_defconfig results in:

drivers/mfd/asic3.c: In function 'asic3_mfd_probe':
drivers/mfd/asic3.c:940:2: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Parsons <redacted>
Cc: Philipp Zabel <redacted>
Cc: Samuel Ortiz <redacted>
---
 drivers/mfd/asic3.c |    1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 383421b..683e18a 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -925,6 +925,7 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
 			goto out;
 	}
 
+	ret = 0;
 	if (pdata->leds) {
 		int i;
 
-- 
1.7.10
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help