mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 02:04:19 +08:00
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: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d00b74613f
commit
7f51cf2ea7
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user