projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54f0a51
)
regulator: tps65218: Add NULL test for devm_kzalloc call
author
Axel Lin
<axel.lin@ingics.com>
Mon, 13 Nov 2017 12:52:32 +0000
(20:52 +0800)
committer
Mark Brown
<broonie@kernel.org>
Thu, 16 Nov 2017 11:59:09 +0000
(11:59 +0000)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/tps65218-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/tps65218-regulator.c
b/drivers/regulator/tps65218-regulator.c
index
b6f7052
..
1827185
100644
(file)
--- a/
drivers/regulator/tps65218-regulator.c
+++ b/
drivers/regulator/tps65218-regulator.c
@@
-326,6
+326,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, ®ulators[i],