diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2015-09-21 17:58:20 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-09-23 19:59:19 +0300 |
commit | 28153a31b8b6c44e4f1e24dafce2f1b22cec427b (patch) | |
tree | b0f9f8abe5132be2bcd9e46b31c530a33c379302 /drivers/power | |
parent | 8807feb91b76dc3267cef58302aaeff3430cb8f2 (diff) | |
download | linux-28153a31b8b6c44e4f1e24dafce2f1b22cec427b.tar.xz |
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.c | 2 |
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: |