Skip to content
Commit 39196cfe authored by Colin Ian King's avatar Colin Ian King Committed by Sebastian Reichel
Browse files

power: supply: cpcap-charger: Fix power_supply_put on null battery pointer



Currently if the pointer battery is null there is a null pointer
dereference on the call to power_supply_put.  Fix this by only
performing the put if battery is not null.

Addresses-Coverity: ("Dereference after null check")
Fixes: 4bff91bb ("power: supply: cpcap-charger: Fix missing power_supply_put()")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 51567ad1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment