summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-02-28 22:57:58 +0300
committerSebastian Reichel <sre@kernel.org>2016-03-03 17:07:22 +0300
commit9761dca68c66f6e1305f9c3d5bb5a054512050b3 (patch)
tree77ec849f0a1e3c4ec60b3a0eacdf1db222c96968 /drivers/power
parent754645342a35e422782f7a59545448ff9e933739 (diff)
downloadlinux-9761dca68c66f6e1305f9c3d5bb5a054512050b3.tar.xz
power_supply: 88pm860x_charger: do not pass NULL to power_supply_put
In the case where power_supply_get_by_name returns NULL the current error return path calls power_supply_put with a NULL psy which will cause a null pointer dereference. Avoid this with an immediate return. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/88pm860x_charger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c
index 297e72dc70e6..2b82e44d9027 100644
--- a/drivers/power/88pm860x_charger.c
+++ b/drivers/power/88pm860x_charger.c
@@ -435,7 +435,7 @@ static irqreturn_t pm860x_temp_handler(int irq, void *data)
psy = power_supply_get_by_name(pm860x_supplied_to[0]);
if (!psy)
- goto out;
+ return IRQ_HANDLED;
ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_TEMP, &temp);
if (ret)
goto out;