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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9183d3b1-4f12-4c5a-8210-71388935f08c@kontron.de>
Date: Mon, 8 Apr 2024 17:36:30 +0200
From: Frieder Schrempf <frieder.schrempf@...tron.de>
To: Fabio Estevam <festevam@...il.com>, gregkh@...uxfoundation.org
Cc: mka@...omium.org, linux-usb@...r.kernel.org,
 linux-kernel@...r.kernel.org, Fabio Estevam <festevam@...x.de>
Subject: Re: [PATCH] usb: misc: onboard_usb_hub: Disable the USB hub clock on
 failure

On 08.04.24 17:17, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@...x.de>
> 
> In case regulator_bulk_enable() fails, the previously enabled USB hub
> clock should be disabled.
> 
> Fix it accordingly.
> 
> Fixes: 65e62b8a955a ("usb: misc: onboard_usb_hub: Add support for clock input")
> Signed-off-by: Fabio Estevam <festevam@...x.de>

Oops, sorry. I totally missed that when I was porting the patch from a
downstream tree that didn't have the regulator code path.

Thanks for fixing!

Reviewed-by: Frieder Schrempf <frieder.schrempf@...tron.de>

> ---
>  drivers/usb/misc/onboard_usb_dev.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c
> index 648ea933bdad..f2bcc1a8b95f 100644
> --- a/drivers/usb/misc/onboard_usb_dev.c
> +++ b/drivers/usb/misc/onboard_usb_dev.c
> @@ -93,7 +93,7 @@ static int onboard_dev_power_on(struct onboard_dev *onboard_dev)
>  	if (err) {
>  		dev_err(onboard_dev->dev, "failed to enable supplies: %pe\n",
>  			ERR_PTR(err));
> -		return err;
> +		goto disable_clk;
>  	}
>  
>  	fsleep(onboard_dev->pdata->reset_us);
> @@ -102,6 +102,10 @@ static int onboard_dev_power_on(struct onboard_dev *onboard_dev)
>  	onboard_dev->is_powered_on = true;
>  
>  	return 0;
> +
> +disable_clk:
> +	clk_disable_unprepare(onboard_dev->clk);
> +	return err;
>  }
>  
>  static int onboard_dev_power_off(struct onboard_dev *onboard_dev)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ