lkml.org 
[lkml]   [2021]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH][next] scsi: ufs: Fix unsigned int compared with less than zero
Date
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
\
 
 \ /
  Last update: 2021-08-06 16:44    [W:0.057 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site