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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Oct 2021 12:54:22 +0800
From:   Peter Chen <peter.chen@...nel.org>
To:     Manish Narani <manish.narani@...inx.com>
Cc:     gregkh@...uxfoundation.org, michal.simek@...inx.com,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        git@...inx.com, Subbaraya Sundeep Bhatta <sbhatta@...inx.com>
Subject: Re: [PATCH 3/6] usb: chipidea: Check usb_phy exists before using it

On 21-08-24 22:46:15, Manish Narani wrote:
> usb_phy and usb_phy->set_vbus may not be present all the times
> based on PHY driver used. So check for it.

Please squash this one with the first one.

Peter
> 
> Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@...inx.com>
> Signed-off-by: Michal Simek <michal.simek@...inx.com>
> Signed-off-by: Manish Narani <manish.narani@...inx.com>
> ---
>  drivers/usb/chipidea/otg_fsm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
> index 2f7f94d..5f8f5d2 100644
> --- a/drivers/usb/chipidea/otg_fsm.c
> +++ b/drivers/usb/chipidea/otg_fsm.c
> @@ -472,7 +472,8 @@ static void ci_otg_drv_vbus(struct otg_fsm *fsm, int on)
>  			}
>  		}
>  
> -		if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL)
> +		if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL &&
> +		    ci->usb_phy && ci->usb_phy->set_vbus)
>  			ci->usb_phy->set_vbus(ci->usb_phy, 1);
>  
>  		/* Disable data pulse irq */
> @@ -484,7 +485,8 @@ static void ci_otg_drv_vbus(struct otg_fsm *fsm, int on)
>  		if (ci->platdata->reg_vbus)
>  			regulator_disable(ci->platdata->reg_vbus);
>  
> -		if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL)
> +		if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL &&
> +		    ci->usb_phy && ci->usb_phy->set_vbus)
>  			ci->usb_phy->set_vbus(ci->usb_phy, 0);
>  
>  		fsm->a_bus_drop = 1;
> -- 
> 2.1.1
> 

-- 

Thanks,
Peter Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ