[PATCH 5.14 110/432] scsi: ufs: Fix unsigned int compared with less than zero

Greg Kroah-Hartman
2021-09-16T17:20:38Z

From: Colin Ian King <colin.king@canonical.com>

[ Upstream commit a5402cdcc2a925835db89ea336909b2b724189df ]

Variable 'tag' is currently an unsigned int and is being compared to less
than zero, this check is always false. Fix this by making 'tag' an int.

Link: https://lore.kernel.org/r/20210806144301.19864-1-colin.king@canonical.com
Fixes: 4728ab4a8e64 ("scsi: ufs: Remove ufshcd_valid_tag()")
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Macro compares unsigned to 0")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 1708d7ced527..8275127749d2 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6969,7 +6969,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
struct Scsi_Host *host;
struct ufs_hba *hba;
unsigned long flags;
- unsigned int tag;
+ int tag;
int err = FAILED;
struct ufshcd_lrb *lrbp;
u32 reg;
--
2.30.2