bq2415x_charger: Fix null pointer dereference
PATCH 1/1 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.
Signed-off-by Pali Rohár <[email protected]>
Reported-by Dan Carpenter <[email protected]>
--- drivers/power/bq2415x_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/bq2415x_charger.c +1 -1
@@ -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:
Signature · 1 line
1.7.10.4
Hi Pali,
Quoted 6 lines · Pali Rohár
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.Signed-off-by Pali Rohár <[email protected]>Reported-by Dan Carpenter <[email protected]>
Thanks, queued with proper "Fixes: " tag.
-- Sebastian