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-next>] [day] [month] [year] [list]
Message-ID: <20210409004945.56776-1-cuibixuan@huawei.com>
Date:   Fri, 9 Apr 2021 08:49:45 +0800
From:   Bixuan Cui <cuibixuan@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <agross@...nel.org>
CC:     <john.wanghui@...wei.com>, <bjorn.andersson@...aro.org>,
        <balbi@...nel.org>, <gregkh@...uxfoundation.org>,
        <mgautam@...eaurora.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-usb@...r.kernel.org>, Bixuan Cui <cuibixuan@...wei.com>
Subject: [PATCH] usb: dwc3: qcom: Fixed an issue that the ret value is incorrect in dwc3_qcom_probe()

There is a error message after devm_ioremap_resource failed, and the ret
is needs to be obtained through PTR_ERR(qcom->qscratch_base).
We need to move the dev_err() downwards to ensure that the ret value is
correct.

Fixes: a4333c3a6ba9 ('usb: dwc3: Add Qualcomm DWC3 glue driver')
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Bixuan Cui <cuibixuan@...wei.com>
---
 drivers/usb/dwc3/dwc3-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index e37cc58dfa55..4716ca8c753d 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -774,8 +774,8 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
 
 	qcom->qscratch_base = devm_ioremap_resource(dev, parent_res);
 	if (IS_ERR(qcom->qscratch_base)) {
-		dev_err(dev, "failed to map qscratch, err=%d\n", ret);
 		ret = PTR_ERR(qcom->qscratch_base);
+		dev_err(dev, "failed to map qscratch, err=%d\n", ret);
 		goto clk_disable;
 	}
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ