From: Manivannan Sadhasivam <mani@kernel.org>
To: Asutosh Das <quic_asutoshd@quicinc.com>
Cc: quic_cang@quicinc.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, quic_nguyenb@quicinc.com,
quic_xiaosenh@quicinc.com, stanley.chu@mediatek.com,
adrian.hunter@intel.com, bvanassche@acm.org, avri.altman@wdc.com,
beanhuo@micron.com, linux-arm-msm@vger.kernel.org,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/1] ufs: mcq: qcom: Fix passing zero to PTR_ERR
Date: Thu, 2 Mar 2023 13:00:51 +0530 [thread overview]
Message-ID: <20230302073051.GC2890@thinkpad> (raw)
In-Reply-To: <94ca99b327af634799ce5f25d0112c28cd00970d.1677721072.git.quic_asutoshd@quicinc.com>
On Wed, Mar 01, 2023 at 05:41:06PM -0800, Asutosh Das wrote:
> 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@gmail.com>
> Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Thanks,
Mani
>
> --
> 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
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-03-02 7:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 1:41 [PATCH v2 1/1] ufs: mcq: qcom: Fix passing zero to PTR_ERR Asutosh Das
2023-03-02 2:21 ` Bjorn Andersson
2023-03-02 7:30 ` Manivannan Sadhasivam [this message]
2023-03-07 2:57 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230302073051.GC2890@thinkpad \
--to=mani@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jejb@linux.ibm.com \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=quic_xiaosenh@quicinc.com \
--cc=stanley.chu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox