diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-08-03 21:44:47 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-08-12 05:28:07 -0400 |
commit | fccbd21f333638a33efb6fc65fff58d1bc2a90bd (patch) | |
tree | 250c7eabbe96b9813b51447e1350522cb00e2bc0 /drivers/mfd | |
parent | ef256176c7ede53741ad8c0231db0cc46c0cfce5 (diff) |
mfd: Fix wm8994_device_init() return value
wm8994_device_init() will return 0 in the case of kzalloc fail
in current implementation.
This patch fixes the return value.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/wm8994-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index ec71c9368906..69533f5ab03e 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -326,8 +326,10 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) | |||
326 | wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) * | 326 | wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) * |
327 | ARRAY_SIZE(wm8994_main_supplies), | 327 | ARRAY_SIZE(wm8994_main_supplies), |
328 | GFP_KERNEL); | 328 | GFP_KERNEL); |
329 | if (!wm8994->supplies) | 329 | if (!wm8994->supplies) { |
330 | ret = -ENOMEM; | ||
330 | goto err; | 331 | goto err; |
332 | } | ||
331 | 333 | ||
332 | for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++) | 334 | for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++) |
333 | wm8994->supplies[i].supply = wm8994_main_supplies[i]; | 335 | wm8994->supplies[i].supply = wm8994_main_supplies[i]; |