diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index 6fec45897194..63e66f485cc0 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c @@ -1134,9 +1134,8 @@ static int s2mps11_pmic_probe(struct platform_device *pdev) return -EINVAL; } - s2mps11->ext_control_gpiod = devm_kmalloc_array(&pdev->dev, - rdev_num, sizeof(*s2mps11->ext_control_gpiod), - GFP_KERNEL); + s2mps11->ext_control_gpiod = devm_kcalloc(&pdev->dev, rdev_num, + sizeof(*s2mps11->ext_control_gpiod), GFP_KERNEL); if (!s2mps11->ext_control_gpiod) return -ENOMEM;