Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Samuel Ortiz
8af5fe3b 25fe24f8

+3 -1
+3 -1
drivers/mfd/mfd-core.c
··· 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)