From: Colin King <colin.king@canonical.com>
To: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Daejun Park <daejun7.park@samsung.com>,
linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] scsi: ufs: Fix unsigned int compared with less than zero
Date: Fri, 6 Aug 2021 15:43:01 +0100 [thread overview]
Message-ID: <20210806144301.19864-1-colin.king@canonical.com> (raw)
From: Colin Ian King <colin.king@canonical.com>
Variable tag is currently and unsigned int and is being compared to
less than zero, this check is always false. Fix this by making tag
an int.
Addresses-Coverity: ("Macro compares unsigned to 0")
Fixes: 4728ab4a8e64 ("scsi: ufs: Remove ufshcd_valid_tag()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/ufs/ufshcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 47a5085f16a9..21378682cb4f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6976,7 +6976,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
{
struct Scsi_Host *host = cmd->device->host;
struct ufs_hba *hba = shost_priv(host);
- unsigned int tag = cmd->request->tag;
+ int tag = cmd->request->tag;
struct ufshcd_lrb *lrbp = &hba->lrb[tag];
unsigned long flags;
int err = FAILED;
--
2.31.1
next reply other threads:[~2021-08-06 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 14:43 Colin King [this message]
2021-08-06 22:12 ` [PATCH][next] scsi: ufs: Fix unsigned int compared with less than zero Bart Van Assche
2021-08-10 3:15 ` Martin K. Petersen
2021-08-17 3:17 ` 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=20210806144301.19864-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=daejun7.park@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).