aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8998.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/max8998.c')
-rw-r--r--drivers/regulator/max8998.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index ab67298799f9..fbcb385034a9 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -549,7 +549,7 @@ static __devinit int max8998_pmic_probe(struct platform_device *pdev)
549 if (!max8998) 549 if (!max8998)
550 return -ENOMEM; 550 return -ENOMEM;
551 551
552 size = sizeof(struct regulator_dev *) * (pdata->num_regulators + 1); 552 size = sizeof(struct regulator_dev *) * pdata->num_regulators;
553 max8998->rdev = kzalloc(size, GFP_KERNEL); 553 max8998->rdev = kzalloc(size, GFP_KERNEL);
554 if (!max8998->rdev) { 554 if (!max8998->rdev) {
555 kfree(max8998); 555 kfree(max8998);
@@ -583,7 +583,7 @@ static __devinit int max8998_pmic_probe(struct platform_device *pdev)
583 583
584 return 0; 584 return 0;
585err: 585err:
586 for (i = 0; i <= max8998->num_regulators; i++) 586 for (i = 0; i < max8998->num_regulators; i++)
587 if (rdev[i]) 587 if (rdev[i])
588 regulator_unregister(rdev[i]); 588 regulator_unregister(rdev[i]);
589 589
@@ -599,7 +599,7 @@ static int __devexit max8998_pmic_remove(struct platform_device *pdev)
599 struct regulator_dev **rdev = max8998->rdev; 599 struct regulator_dev **rdev = max8998->rdev;
600 int i; 600 int i;
601 601
602 for (i = 0; i <= max8998->num_regulators; i++) 602 for (i = 0; i < max8998->num_regulators; i++)
603 if (rdev[i]) 603 if (rdev[i])
604 regulator_unregister(rdev[i]); 604 regulator_unregister(rdev[i]);
605 605