]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: ufshpb: Verify that 'num_inflight_map_req' is non-negative
authorAvri Altman <avri.altman@wdc.com>
Sun, 8 Aug 2021 09:00:23 +0000 (12:00 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Aug 2021 02:25:36 +0000 (22:25 -0400)
commit8442d1d8deb37c1182e8f7d31e20aaa27a186dfd
tree8c6f98a4cf0c7d081b0a3d72f692a2998f32f2b8
parente488e6e537329d99945a3c3f1679e46346d589d4
scsi: ufs: ufshpb: Verify that 'num_inflight_map_req' is non-negative

'num_inflight_map_req' should not be negative.  It is incremented and
decremented without any protection, allowing it theoretically to be
negative, should some weird unbalanced count occur.

Verify that the those calls are properly serialized.

Link: https://lore.kernel.org/r/20210808090024.21721-4-avri.altman@wdc.com
Fixes: 0ffd80061d2e (scsi: ufs: ufshpb: Limit the number of in-flight map requests)
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshpb.c
drivers/scsi/ufs/ufshpb.h