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>
This commit is contained in:
parent
54f0a51a73
commit
5597bfb474
|
@ -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],
|
||||
|
|
Loading…
Reference in New Issue