diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/lp3971.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index f5532ed79272..55fab4a30645 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c | |||
@@ -439,6 +439,10 @@ static int __devinit setup_regulators(struct lp3971 *lp3971, | |||
439 | lp3971->num_regulators = pdata->num_regulators; | 439 | lp3971->num_regulators = pdata->num_regulators; |
440 | lp3971->rdev = kcalloc(pdata->num_regulators, | 440 | lp3971->rdev = kcalloc(pdata->num_regulators, |
441 | sizeof(struct regulator_dev *), GFP_KERNEL); | 441 | sizeof(struct regulator_dev *), GFP_KERNEL); |
442 | if (!lp3971->rdev) { | ||
443 | err = -ENOMEM; | ||
444 | goto err_nomem; | ||
445 | } | ||
442 | 446 | ||
443 | /* Instantiate the regulators */ | 447 | /* Instantiate the regulators */ |
444 | for (i = 0; i < pdata->num_regulators; i++) { | 448 | for (i = 0; i < pdata->num_regulators; i++) { |
@@ -461,6 +465,7 @@ error: | |||
461 | regulator_unregister(lp3971->rdev[i]); | 465 | regulator_unregister(lp3971->rdev[i]); |
462 | kfree(lp3971->rdev); | 466 | kfree(lp3971->rdev); |
463 | lp3971->rdev = NULL; | 467 | lp3971->rdev = NULL; |
468 | err_nomem: | ||
464 | return err; | 469 | return err; |
465 | } | 470 | } |
466 | 471 | ||