lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 11 Mar 2022 06:12:54 +0000
From:   Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC:     "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: dwc2: Add missing check for dwc2_vbus_supply_init

On 3/10/2022 10:33 AM, Jiasheng Jiang wrote:
> As the potential failure of the dwc2_vbus_supply_init(),
> it should be better to handle the return value and check
> it.
> 
> Fixes: cd7cd0e6cedf ("usb: dwc2: fix unbalanced use of external vbus-supply")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>

Acked-by: Minas Harutyunyan <hminas@...opsys.com>

> ---
>   drivers/usb/dwc2/hcd.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index f63a27d11fac..c8786d223dcd 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -3672,7 +3672,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
>   			hprt0 |= HPRT0_PWR;
>   			dwc2_writel(hsotg, hprt0, HPRT0);
>   			if (!pwr)
> -				dwc2_vbus_supply_init(hsotg);
> +				retval = dwc2_vbus_supply_init(hsotg);
>   			break;
>   
>   		case USB_PORT_FEAT_RESET:
> @@ -3722,7 +3722,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
>   					"In host mode, hprt0=%08x\n", hprt0);
>   				dwc2_writel(hsotg, hprt0, HPRT0);
>   				if (!pwr)
> -					dwc2_vbus_supply_init(hsotg);
> +					retval = dwc2_vbus_supply_init(hsotg);
>   			}
>   
>   			/* Clear reset bit in 10ms (FS/LS) or 50ms (HS) */
> @@ -4523,7 +4523,9 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
>   
>   	/* Enable external vbus supply after resuming the port. */
>   	spin_unlock_irqrestore(&hsotg->lock, flags);
> -	dwc2_vbus_supply_init(hsotg);
> +	ret = dwc2_vbus_supply_init(hsotg);
> +	if (ret)
> +		return ret;
>   
>   	/* Wait for controller to correctly update D+/D- level */
>   	usleep_range(3000, 5000);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ