summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2015-09-21 16:58:20 +0200
committerSebastian Reichel <sre@kernel.org>2015-09-23 18:59:19 +0200
commit28153a31b8b6c44e4f1e24dafce2f1b22cec427b (patch)
treeb0f9f8abe5132be2bcd9e46b31c530a33c379302 /drivers/power
parent8807feb91b76dc3267cef58302aaeff3430cb8f2 (diff)
bq2415x_charger: Fix null pointer dereference
Commit b68c3161430a (bq2415x_charger: Allow to load and use driver even if notify device is not registered yet) introduced null pointer dereference in case bq is NULL. This patch fixes it. Fixes: b68c3161430a ("bq2415x_charger: Allow to load and use driver even if notify device is not registered yet") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/bq2415x_charger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index ec212b5be755..4afd76848bce 100644
--- a/drivers/power/bq2415x_charger.c
+++ b/drivers/power/bq2415x_charger.c
@@ -1704,7 +1704,7 @@ error_4:
error_3:
bq2415x_power_supply_exit(bq);
error_2:
- if (bq->notify_node)
+ if (bq && bq->notify_node)
of_node_put(bq->notify_node);
kfree(name);
error_1: