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]
Message-ID: <YcLwh06Z/1hBG6IY@kroah.com>
Date:   Wed, 22 Dec 2021 10:31:51 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Miaoqian Lin <linmq006@...il.com>
Cc:     linmq006@...il.com, Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Shawn Guo <shawn.guo@...aro.org>,
        linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: dwc3: qcom: Fix NULL vs IS_ERR checking in
 dwc3_qcom_probe

[note, you got the to: line incorrect...]

On Wed, Dec 22, 2021 at 09:14:44AM +0000, Miaoqian Lin wrote:
> Since the acpi_create_platform_device() function may return error
> pointers, dwc3_qcom_create_urs_usb_platdev() function may return errors
> too. Using IS_ERR_OR_NULL() to check the return value to fix this.
> 
> Fixes: c25c210f590e("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot")

Nit, the documentation says this should be:
Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot")


> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
>  drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 3cb01cdd02c2..df27d903ba98 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -769,9 +769,9 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>  
>  		if (qcom->acpi_pdata->is_urs) {
>  			qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev);
> -			if (!qcom->urs_usb) {
> +			if (IS_ERR_OR_NULL(qcom->urs_usb)) {
>  				dev_err(dev, "failed to create URS USB platdev\n");
> -				return -ENODEV;
> +				return qcom->urs_usb ? PTR_ERR(qcom->urs_usb) : -ENODEV;

Please no ? : if at all possible.  Spell it out as a real if statement.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ