All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] USB: ehci-platform: fix companion-device leak
@ 2017-05-16 14:26 Johan Hovold
  2017-05-17  4:53 ` Yoshihiro Shimoda
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2017-05-16 14:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Alan Stern, linux-usb, Johan Hovold, stable, Yoshihiro Shimoda

Make sure do drop the reference taken to the companion device during
resume.

Fixes: d4d75128b8fd ("usb: host: ehci-platform: fix usb 1.1 device is not connected in system resume")
Cc: stable <stable@vger.kernel.org>     # 4.11
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/host/ehci-platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index bc7b9be12f54..f1908ea9fbd8 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -384,8 +384,10 @@ static int ehci_platform_resume(struct device *dev)
 	}
 
 	companion_dev = usb_of_get_companion_dev(hcd->self.controller);
-	if (companion_dev)
+	if (companion_dev) {
 		device_pm_wait_for_dev(hcd->self.controller, companion_dev);
+		put_device(companion_dev);
+	}
 
 	ehci_resume(hcd, priv->reset_on_resume);
 	return 0;
-- 
2.13.0

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

end of thread, other threads:[~2017-05-18  1:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 14:26 [PATCH 1/2] USB: ehci-platform: fix companion-device leak Johan Hovold
2017-05-17  4:53 ` Yoshihiro Shimoda
2017-05-17  8:59   ` Johan Hovold
2017-05-18  1:50     ` Yoshihiro Shimoda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.