scsi: ufs: Remove ufshcd_valid_tag()
authorBart Van Assche <bvanassche@acm.org>
Thu, 22 Jul 2021 03:34:27 +0000 (20:34 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 3 Aug 2021 01:43:57 +0000 (21:43 -0400)
commit4728ab4a8e64902b0b0c5238ed09128ea20aa5ce
tree07829d2b9d676a9c10338686737ec3976dda218c
parent8a686f26eaa4b8a5c494b6b69e8a97815e3ffb82
scsi: ufs: Remove ufshcd_valid_tag()

scsi_add_host() allocates shost->can_queue tags. ufshcd_init() sets
shost->can_queue to hba->nutrs. In other words, we know that tag values
will less than hba->nutrs. Hence remove the checks that verify that
blk_get_request() returns a tag less than hba->nutrs. This check was
introduced by commit 14497328b6a6 ("scsi: ufs: verify command tag
validity").

Keep the tag >= 0 check because it helps to detect use-after-free issues.

Link: https://lore.kernel.org/r/20210722033439.26550-7-bvanassche@acm.org
CC: Avri Altman <avri.altman@wdc.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c