From: Mark Brown Date: Fri, 17 Jun 2011 11:19:41 +0000 (+0100) Subject: mfd: Fix error handling if BUG() isn't enabled in WM8994 X-Git-Tag: v3.1-rc1~100^2~34 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f85dbda076a11c18b396f8acfff929e53159e56d;p=pandora-kernel.git mfd: Fix error handling if BUG() isn't enabled in WM8994 Even if we would've BUG()ed we should still tidy up after ourselves if that isn't enabled in the kernel config. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 7caf0d82a9a2..96479c9b1728 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -409,7 +409,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) break; default: BUG(); - return -EINVAL; + goto err; } wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) * @@ -431,7 +431,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) break; default: BUG(); - return -EINVAL; + goto err; } ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,