diff mbox series

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

Message ID 20210916155814.503823240@linuxfoundation.org
State New
Headers show
Series None | expand

Commit Message

gregkh@linuxfoundation.org Sept. 16, 2021, 3:57 p.m. UTC
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 mbox series

Patch

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;