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]
Message-ID: <20250110023756.shkrjhvoka5h2td3@synopsys.com>
Date: Fri, 10 Jan 2025 02:37:58 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: "Rob Herring (Arm)" <robh@...nel.org>
CC: Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: dwc3: omap: Fix devm_regulator_get_optional() error
 handling

On Thu, Jan 09, 2025, Rob Herring (Arm) wrote:
> Commit 533561a8aad5 ("usb: dwc3: omap: Use
> devm_regulator_get_optional()") assumed NULL was returned, but
> devm_regulator_get_optional() returns -ENODEV rather than NULL like
> other *_get_optional() functions.
> 
> Fixes: 533561a8aad5 ("usb: dwc3: omap: Use devm_regulator_get_optional()")
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> ---
>  drivers/usb/dwc3/dwc3-omap.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 9b1d10ac33c1..fe74d11bb629 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -484,8 +484,11 @@ static int dwc3_omap_probe(struct platform_device *pdev)
>  		return PTR_ERR(base);
>  
>  	vbus_reg = devm_regulator_get_optional(dev, "vbus");
> -	if (IS_ERR(vbus_reg))
> -		return dev_err_probe(dev, PTR_ERR(vbus_reg), "vbus init failed\n");
> +	if (IS_ERR(vbus_reg)) {
> +		if (PTR_ERR(vbus_reg) != -ENODEV)
> +			return dev_err_probe(dev, PTR_ERR(vbus_reg), "vbus init failed\n");
> +		vbus_reg = NULL;
> +	}
>  
>  	omap->dev	= dev;
>  	omap->irq	= irq;
> -- 
> 2.45.2
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@...opsys.com>

Thanks,
Thinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ