Commit 8af5fe3bc59d73479ff701340e1a9bc7c6b5f0ff

Authored by Axel Lin
Committed by Samuel Ortiz
1 parent 25fe24f884

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>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

drivers/mfd/mfd-core.c
... ... @@ -70,7 +70,9 @@
70 70 goto fail_res;
71 71 }
72 72  
73   - platform_device_add_resources(pdev, res, cell->num_resources);
  73 + ret = platform_device_add_resources(pdev, res, cell->num_resources);
  74 + if (ret)
  75 + goto fail_res;
74 76  
75 77 ret = platform_device_add(pdev);
76 78 if (ret)