Commit af3de02e authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jiri Slaby

power_supply: 88pm860x: Fix leaked power supply on probe fail

commit 24727b45 upstream.

Driver forgot to unregister power supply if request_threaded_irq()
failed in probe(). In such case the memory associated with power supply
leaked.
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: a830d28b ("power_supply: Enable battery-charger for 88pm860x")
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent a80c9329
...@@ -711,6 +711,7 @@ static int pm860x_charger_probe(struct platform_device *pdev) ...@@ -711,6 +711,7 @@ static int pm860x_charger_probe(struct platform_device *pdev)
return 0; return 0;
out_irq: out_irq:
power_supply_unregister(&info->usb);
while (--i >= 0) while (--i >= 0)
free_irq(info->irq[i], info); free_irq(info->irq[i], info);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment