* [PATCH] bq2415x_charger: Fix null pointer dereference
@ 2015-09-21 14:58 Pali Rohár
2015-09-23 17:04 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Pali Rohár @ 2015-09-21 14:58 UTC (permalink / raw)
To: Sebastian Reichel, Dmitry Eremin-Solenikov, David Woodhouse
Cc: linux-pm, linux-kernel, Dan Carpenter, 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 <pali.rohar@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/power/bq2415x_charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index ec212b5..4afd768 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:
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bq2415x_charger: Fix null pointer dereference
2015-09-21 14:58 [PATCH] bq2415x_charger: Fix null pointer dereference Pali Rohár
@ 2015-09-23 17:04 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2015-09-23 17:04 UTC (permalink / raw)
To: Pali Rohár
Cc: Dmitry Eremin-Solenikov, David Woodhouse, linux-pm, linux-kernel,
Dan Carpenter
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
Hi Pali,
On Mon, Sep 21, 2015 at 04:58:20PM +0200, Pali Rohár wrote:
> 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 <pali.rohar@gmail.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks, queued with proper "Fixes: " tag.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-23 17:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 14:58 [PATCH] bq2415x_charger: Fix null pointer dereference Pali Rohár
2015-09-23 17:04 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).