Commit 5597bfb4 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: tps65218: Add NULL test for devm_kzalloc call

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Reviewed-by: default avatarKeerthy <j-keerthy@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 54f0a51a
......@@ -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, &regulators[i],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment