OSDN Git Service

power: qcom-step-chg: Fix the error return path
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Wed, 16 Aug 2017 18:55:18 +0000 (11:55 -0700)
committerSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Tue, 22 Aug 2017 22:04:53 +0000 (15:04 -0700)
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>
drivers/power/supply/qcom/step-chg-jeita.c

index 5b41a45..06ecc7e 100644 (file)
@@ -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);