diff options
author | Axel Lin <axel.lin@ingics.com> | 2017-11-13 07:52:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-16 06:59:09 -0500 |
commit | 5597bfb474d3ed84c1e0c73db620a257bbe127b6 (patch) | |
tree | 34d1d145088ede9d7be331c4a53d9af6b876a39e | |
parent | 54f0a51a73acba08f047881c397e4040a573339b (diff) |
regulator: tps65218: Add NULL test for devm_kzalloc call
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/tps65218-regulator.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index b6f705292aef..1827185beacc 100644 --- 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) | |||
326 | /* Allocate memory for strobes */ | 326 | /* Allocate memory for strobes */ |
327 | tps->strobes = devm_kzalloc(&pdev->dev, sizeof(u8) * | 327 | tps->strobes = devm_kzalloc(&pdev->dev, sizeof(u8) * |
328 | TPS65218_NUM_REGULATOR, GFP_KERNEL); | 328 | TPS65218_NUM_REGULATOR, GFP_KERNEL); |
329 | if (!tps->strobes) | ||
330 | return -ENOMEM; | ||
329 | 331 | ||
330 | for (i = 0; i < ARRAY_SIZE(regulators); i++) { | 332 | for (i = 0; i < ARRAY_SIZE(regulators); i++) { |
331 | rdev = devm_regulator_register(&pdev->dev, ®ulators[i], | 333 | rdev = devm_regulator_register(&pdev->dev, ®ulators[i], |