linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power_supply: 88pm860x: Fix leaked power supply on probe fail
@ 2015-01-27 15:51 Krzysztof Kozlowski
  2015-01-28 14:08 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2015-01-27 15:51 UTC (permalink / raw)
  To: Sebastian Reichel, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski, stable

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: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: a830d28b48bf ("power_supply: Enable battery-charger for 88pm860x")
Cc: <stable@vger.kernel.org>
---
 drivers/power/88pm860x_charger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c
index 650930e4fa79..734ec4afa14d 100644
--- a/drivers/power/88pm860x_charger.c
+++ b/drivers/power/88pm860x_charger.c
@@ -711,6 +711,7 @@ static int pm860x_charger_probe(struct platform_device *pdev)
 	return 0;
 
 out_irq:
+	power_supply_unregister(&info->usb);
 	while (--i >= 0)
 		free_irq(info->irq[i], info);
 out:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power_supply: 88pm860x: Fix leaked power supply on probe fail
  2015-01-27 15:51 [PATCH] power_supply: 88pm860x: Fix leaked power supply on probe fail Krzysztof Kozlowski
@ 2015-01-28 14:08 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2015-01-28 14:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Dmitry Eremin-Solenikov, David Woodhouse, linux-pm, linux-kernel, stable

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Hi,

On Tue, Jan 27, 2015 at 04:51:54PM +0100, Krzysztof Kozlowski wrote:
> 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: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Fixes: a830d28b48bf ("power_supply: Enable battery-charger for 88pm860x")
> Cc: <stable@vger.kernel.org>

Thanks, applied.

-- 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-01-29  1:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 15:51 [PATCH] power_supply: 88pm860x: Fix leaked power supply on probe fail Krzysztof Kozlowski
2015-01-28 14:08 ` 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).