]> git.karo-electronics.de Git - karo-tx-linux.git/commit
power_supply: 88pm860x_charger: do not pass NULL to power_supply_put
authorColin Ian King <colin.king@canonical.com>
Sun, 28 Feb 2016 19:57:58 +0000 (19:57 +0000)
committerSebastian Reichel <sre@kernel.org>
Thu, 3 Mar 2016 14:07:22 +0000 (15:07 +0100)
commit9761dca68c66f6e1305f9c3d5bb5a054512050b3
tree77ec849f0a1e3c4ec60b3a0eacdf1db222c96968
parent754645342a35e422782f7a59545448ff9e933739
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>
drivers/power/88pm860x_charger.c