aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-05-31 17:30:55 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2010-08-12 11:27:19 +0200
commit8af5fe3bc59d73479ff701340e1a9bc7c6b5f0ff (patch)
treedb9ae235ef680ce0778a9269aae394a2bbb11720 /drivers/mfd
parentmfd: kzalloc doesn't return ERR_PTR (diff)
downloadlinux-dev-8af5fe3bc59d73479ff701340e1a9bc7c6b5f0ff.tar.xz
linux-dev-8af5fe3bc59d73479ff701340e1a9bc7c6b5f0ff.zip
mfd: properly handle platform_device_add_resources fail in mfd_add_device
platform_device_add_resources may fail, thus add error checking for it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mfd-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 7dd76bceaae8..1823a57b7d8f 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -70,7 +70,9 @@ static int mfd_add_device(struct device *parent, int id,
goto fail_res;
}
- platform_device_add_resources(pdev, res, cell->num_resources);
+ ret = platform_device_add_resources(pdev, res, cell->num_resources);
+ if (ret)
+ goto fail_res;
ret = platform_device_add(pdev);
if (ret)