mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: tps65218: Add NULL test for devm_kzalloc call
@ 2017-11-13 12:52 Axel Lin
  2017-11-16 11:23 ` Keerthy
  2017-11-16 19:29 ` Applied "regulator: tps65218: Add NULL test for devm_kzalloc call" to the regulator tree Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2017-11-13 12:52 UTC (permalink / raw)
  To: Mark Brown; +Cc: Keerthy, Liam Girdwood, linux-kernel, Axel Lin

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/tps65218-regulator.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index bc489958fed7..b3f89ebfb1a0 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -329,6 +329,8 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
 	/* Allocate memory for strobes */
 	tps->strobes = devm_kzalloc(&pdev->dev, sizeof(u8) *
 				    TPS65218_NUM_REGULATOR, GFP_KERNEL);
+	if (!tps->strobes)
+		return -ENOMEM;
 
 	for (i = 0; i < ARRAY_SIZE(regulators); i++) {
 		rdev = devm_regulator_register(&pdev->dev, &regulators[i],
-- 
2.11.0

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

end of thread, other threads:[~2017-11-17  4:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 12:52 [PATCH] regulator: tps65218: Add NULL test for devm_kzalloc call Axel Lin
2017-11-16 11:23 ` Keerthy
2017-11-17  3:58   ` Axel Lin
2017-11-17  4:11     ` Joe Perches
2017-11-16 19:29 ` Applied "regulator: tps65218: Add NULL test for devm_kzalloc call" to the regulator tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome