RE: [PATCH 1/2] USB: ehci-platform: fix companion-device leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

> From: Johan Hovold
> Sent: Tuesday, May 16, 2017 11:26 PM
> 
> 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@xxxxxxxxxxxxxxx>     # 4.11
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> ---
>  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);

Thank you for the patch!

I should have added an API like "usb_of_put_companion_dev(dev)"
and it calls "of_dev_put(to_platform_device(dev))". And then,
ehci_platform_resume() can call the API instead of put_device().
But, adding new API is not good for stable.

So,

Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>

Best regards,
Yoshihiro Shimoda

>  	ehci_resume(hcd, priv->reset_on_resume);
>  	return 0;
> --
> 2.13.0





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]