]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitebf807eeabed93458535409361bf2f258f820797
tree07829d2b9d676a9c10338686737ec3976dda218c
parent4bd93945a61eb4bbbbc877a5c5f91b09c3b51452
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 161a1bf21716 ("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