diff options
| author | Subbaraman Narayanamurthy <subbaram@codeaurora.org> | 2017-08-16 11:55:18 -0700 |
|---|---|---|
| committer | Subbaraman Narayanamurthy <subbaram@codeaurora.org> | 2017-08-22 15:04:53 -0700 |
| commit | d3aa08187615f3d64e8ee509bed038eeb4f0eb8b (patch) | |
| tree | 5ecd307a8bfdb972ce351701bd3ac741acb03ce3 | |
| parent | a49bb61510b938152025049730fa922c5da950a1 (diff) | |
power: qcom-step-chg: Fix the error return path
Fix the error return path in qcom_step_chg_init() to free up the
allocated memory and registered wake source.
Change-Id: I8f93246d27f79a7c759b3afc4a4544d9ffca7a80
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
| -rw-r--r-- | drivers/power/supply/qcom/step-chg-jeita.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/power/supply/qcom/step-chg-jeita.c b/drivers/power/supply/qcom/step-chg-jeita.c index 5b41a456c6db..06ecc7ea6e8a 100644 --- a/drivers/power/supply/qcom/step-chg-jeita.c +++ b/drivers/power/supply/qcom/step-chg-jeita.c @@ -443,21 +443,24 @@ int qcom_step_chg_init(bool step_chg_enable, bool sw_jeita_enable) !step_chg_config.prop_name)) { /* fail if step-chg configuration is invalid */ pr_err("Step-chg configuration not defined - fail\n"); - return -ENODATA; + rc = -ENODATA; + goto release_wakeup_source; } if (sw_jeita_enable && (!jeita_fcc_config.psy_prop || !jeita_fcc_config.prop_name)) { /* fail if step-chg configuration is invalid */ pr_err("Jeita TEMP configuration not defined - fail\n"); - return -ENODATA; + rc = -ENODATA; + goto release_wakeup_source; } if (sw_jeita_enable && (!jeita_fv_config.psy_prop || !jeita_fv_config.prop_name)) { /* fail if step-chg configuration is invalid */ pr_err("Jeita TEMP configuration not defined - fail\n"); - return -ENODATA; + rc = -ENODATA; + goto release_wakeup_source; } INIT_DELAYED_WORK(&chip->status_change_work, status_change_work); |
