From: Axel Lin Date: Wed, 4 Aug 2010 01:44:47 +0000 (+0800) Subject: mfd: Fix wm8994_device_init() return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fccbd21f333638a33efb6fc65fff58d1bc2a90bd;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Acked-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index ec71c936890..69533f5ab03 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) wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) * ARRAY_SIZE(wm8994_main_supplies), GFP_KERNEL); - if (!wm8994->supplies) + if (!wm8994->supplies) { + ret = -ENOMEM; goto err; + } for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++) wm8994->supplies[i].supply = wm8994_main_supplies[i];