]> Git Repo - linux.git/commitdiff
mfd: properly handle platform_device_add_resources fail in mfd_add_device
authorAxel Lin <[email protected]>
Mon, 31 May 2010 09:30:55 +0000 (17:30 +0800)
committerSamuel Ortiz <[email protected]>
Thu, 12 Aug 2010 09:27:19 +0000 (11:27 +0200)
platform_device_add_resources may fail, thus add error checking for it.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
drivers/mfd/mfd-core.c

index 7dd76bceaae812ea439d69390dce8f71ca565ef7..1823a57b7d8f06f083f921bd7e9cfaa4f40c98a8 100644 (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)
This page took 0.054054 seconds and 4 git commands to generate.