linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] regulator: anatop: check return value of of_get_regulator_init_data
@ 2017-04-12  1:58 Dong Aisheng
  2017-04-11 20:42 ` Applied "regulator: anatop: check return value of of_get_regulator_init_data" to the regulator tree Mark Brown
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Dong Aisheng @ 2017-04-12  1:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: shawnguo, linux-arm-kernel, aisheng.dong, kernel, lgirdwood,
	broonie, yibin.gong

Should check the return value of of_get_regulator_init_data before
using it.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/regulator/anatop-regulator.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index b041f27..46b9c2c 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -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;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-04-12 16:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12  1:58 [PATCH 1/6] regulator: anatop: check return value of of_get_regulator_init_data Dong Aisheng
2017-04-11 20:42 ` Applied "regulator: anatop: check return value of of_get_regulator_init_data" to the regulator tree Mark Brown
2017-04-12  1:58 ` [PATCH 2/6] regulator: anatop: only set supply regulator when it actually exists Dong Aisheng
2017-04-11 20:31   ` Mark Brown
2017-04-13  7:11     ` Dong Aisheng
2017-04-12 15:53       ` Mark Brown
2017-04-12 16:00         ` Dong Aisheng
2017-04-12 16:06           ` Mark Brown
2017-04-12  1:58 ` [PATCH 3/6] regulator: anatop: use of_property_read_string to read the name Dong Aisheng
2017-04-11 20:42   ` Applied "regulator: anatop: use of_property_read_string to read the name" to the regulator tree Mark Brown
2017-04-12  1:58 ` [PATCH 4/6] regulator: anatop: remove unneeded name field of struct anatop_regulator Dong Aisheng
2017-04-11 20:42   ` Applied "regulator: anatop: remove unneeded name field of struct anatop_regulator" to the regulator tree Mark Brown
2017-04-12  1:58 ` [PATCH 5/6] regulator: anatop-regulator: make regulator-name using optionally Dong Aisheng
2017-04-11 20:38   ` Mark Brown
2017-04-13  7:31     ` Dong Aisheng
2017-04-12  1:58 ` [PATCH 6/6] regulator: anatop: set default voltage selector for pcie Dong Aisheng
2017-04-11 20:40   ` Mark Brown
2017-04-13  7:41     ` Dong Aisheng
2017-04-12 15:49       ` Mark Brown
2017-04-12 16:11         ` Dong Aisheng
2017-04-12 16:11       ` Lucas Stach
2017-04-12 16:16         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).