linux-stable/drivers/scsi/pm8001
Colin Ian King 40fa7394a1 scsi: pm80xx: Fix potential infinite loop
The for-loop iterates with a u8 loop counter i and compares this with the
loop upper limit of pm8001_ha->max_q_num which is a u32 type.  There is a
potential infinite loop if pm8001_ha->max_q_num is larger than the u8 loop
counter. Fix this by making the loop counter the same type as
pm8001_ha->max_q_num.

[mkp: this is purely theoretical, max_q_num is currently limited to 64]

Link: https://lore.kernel.org/r/20210407135840.494747-1-colin.king@canonical.com
Fixes: 65df7d1986 ("scsi: pm80xx: Fix chip initialization failure")
Addresses-Coverity: ("Infinite loop")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-04-12 23:20:42 -04:00
..
Makefile
pm80xx_hwi.c scsi: pm80xx: Remove busy wait from mpi_uninit_check() 2021-04-12 23:07:10 -04:00
pm80xx_hwi.h scsi: pm80xx: Check for fatal error 2021-01-13 00:02:01 -05:00
pm8001_chips.h
pm8001_ctl.c scsi: pm8001: Fix incorrectly named functions in headers 2021-03-15 22:14:51 -04:00
pm8001_ctl.h
pm8001_defs.h scsi: pm80xx: Increase the number of outstanding I/O supported to 1024 2020-10-07 23:50:04 -04:00
pm8001_hwi.c scsi: pm80xx: Fix potential infinite loop 2021-04-12 23:20:42 -04:00
pm8001_hwi.h scsi: pm80xx: Fix for phy enable/disable functionality 2018-09-11 21:13:08 -04:00
pm8001_init.c scsi: pm8001: Avoid -Wrestrict warning 2021-03-24 23:16:14 -04:00
pm8001_sas.c scsi: pm8001: Provide function name 'pm8001_I_T_nexus_reset()' in header 2021-03-15 22:14:51 -04:00
pm8001_sas.h scsi: pm80xx: Remove list entry from pm8001_ccb_info 2021-03-09 23:22:03 -05:00