summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-09 01:32:10 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-09 01:32:09 -0800
commit69fd33f749833d216b5d2d28ef076d35fe18bf5c (patch)
tree40fdc55779082ffed676b66d89c4ee4ad47f30b7
parent3a12198f5566fc48ab7eaf50fa4e1a7e70b56063 (diff)
parenta154041d04c9e35eabab94ebae0895cc8d23f5d8 (diff)
Merge "qcom-charger: Fix crash due to null ptr access of pl psy"
-rw-r--r--drivers/power/qcom-charger/qpnp-smb2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/qcom-charger/qpnp-smb2.c
index cd137790ba42..a07325102631 100644
--- a/drivers/power/qcom-charger/qpnp-smb2.c
+++ b/drivers/power/qcom-charger/qpnp-smb2.c
@@ -1884,6 +1884,12 @@ static int smb2_probe(struct platform_device *pdev)
goto cleanup;
}
+ rc = smb2_init_hw(chip);
+ if (rc < 0) {
+ pr_err("Couldn't initialize hardware rc=%d\n", rc);
+ goto cleanup;
+ }
+
rc = smb2_init_dc_psy(chip);
if (rc < 0) {
pr_err("Couldn't initialize dc psy rc=%d\n", rc);
@@ -1916,12 +1922,6 @@ static int smb2_probe(struct platform_device *pdev)
goto cleanup;
}
- rc = smb2_init_hw(chip);
- if (rc < 0) {
- pr_err("Couldn't initialize hardware rc=%d\n", rc);
- goto cleanup;
- }
-
rc = smb2_determine_initial_status(chip);
if (rc < 0) {
pr_err("Couldn't determine initial status rc=%d\n",