Commit 8af5fe3b authored by Axel Lin's avatar Axel Lin Committed by Samuel Ortiz

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 25fe24f8
...@@ -70,7 +70,9 @@ static int mfd_add_device(struct device *parent, int id, ...@@ -70,7 +70,9 @@ static int mfd_add_device(struct device *parent, int id,
goto fail_res; 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); ret = platform_device_add(pdev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment