Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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],