Skip to content

Commit

Permalink
bq2415x_charger: Fix null pointer dereference
Browse files Browse the repository at this point in the history
Commit b68c316 (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: b68c316 ("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>
  • Loading branch information
Pali Rohár authored and Sebastian Reichel committed Sep 23, 2015
1 parent 8807feb commit 28153a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/bq2415x_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ static int bq2415x_probe(struct i2c_client *client,
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:
Expand Down

0 comments on commit 28153a3

Please sign in to comment.