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

Commit 7f51cf2e authored by Dong Aisheng's avatar Dong Aisheng Committed by Mark Brown
Browse files

regulator: anatop: check return value of of_get_regulator_init_data



Should check the return value of of_get_regulator_init_data before
using it.

Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d00b7461
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -200,6 +200,9 @@ static int anatop_regulator_probe(struct platform_device *pdev)
	rdesc->owner = THIS_MODULE;

	initdata = of_get_regulator_init_data(dev, np, rdesc);
	if (!initdata)
		return -ENOMEM;

	initdata->supply_regulator = "vin";
	sreg->initdata = initdata;