Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28153a31 authored by Pali Rohár's avatar Pali Rohár Committed by Sebastian Reichel
Browse files

bq2415x_charger: Fix null pointer dereference



Commit b68c3161 (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: b68c3161 ("bq2415x_charger: Allow to load and use driver even if notify device is not registered yet")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 8807feb9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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: