Skip to content

Commit

Permalink
regulator: tps65218: Add NULL test for devm_kzalloc call
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Nov 16, 2017
1 parent 54f0a51 commit 5597bfb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/regulator/tps65218-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 5597bfb

Please sign in to comment.