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-next>] [day] [month] [year] [list]
Message-ID: <94ca99b327af634799ce5f25d0112c28cd00970d.1677721072.git.quic_asutoshd@quicinc.com>
Date:   Wed, 1 Mar 2023 17:41:06 -0800
From:   Asutosh Das <quic_asutoshd@...cinc.com>
To:     <quic_cang@...cinc.com>, <martin.petersen@...cle.com>,
        <linux-scsi@...r.kernel.org>
CC:     <quic_nguyenb@...cinc.com>, <quic_xiaosenh@...cinc.com>,
        <stanley.chu@...iatek.com>, <adrian.hunter@...el.com>,
        <bvanassche@....org>, <avri.altman@....com>, <mani@...nel.org>,
        <beanhuo@...ron.com>, Asutosh Das <quic_asutoshd@...cinc.com>,
        <linux-arm-msm@...r.kernel.org>, Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "open list" <linux-kernel@...r.kernel.org>
Subject: [PATCH v2 1/1] ufs: mcq: qcom: Fix passing zero to PTR_ERR

Fix an error case in ufs_qcom_mcq_config_resource(), where the
return value is set to 0 before passing it to PTR_ERR.

This led to Smatch warning:
drivers/ufs/host/ufs-qcom.c:1455 ufs_qcom_mcq_config_resource() warn:
passing zero to 'PTR_ERR'

Fixes: c263b4ef737e ("scsi: ufs: core: mcq: Configure resource regions")
Reported-by: Dan Carpenter <error27@...il.com>
Signed-off-by: Asutosh Das <quic_asutoshd@...cinc.com>

--
v1 -> v2
- Split to 2 patches
- Addressed Mani's comments
--
---
 drivers/ufs/host/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 34fc453f3eb1..43b1fc1ad33e 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1451,8 +1451,8 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
 		if (IS_ERR(res->base)) {
 			dev_err(hba->dev, "Failed to map res %s, err=%d\n",
 					 res->name, (int)PTR_ERR(res->base));
-			res->base = NULL;
 			ret = PTR_ERR(res->base);
+			res->base = NULL;
 			return ret;
 		}
 	}
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ