Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)