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>
This commit is contained in:
Axel Lin 2010-05-31 17:30:55 +08:00 committed by Samuel Ortiz
parent 25fe24f884
commit 8af5fe3bc5
1 changed files with 3 additions and 1 deletions

View File

@ -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)