linux/drivers/scsi/lpfc
Dick Kennedy 77dd7d7b34 scsi: lpfc: Fix less-than-zero comparison of unsigned value
The expression start_idx - dbg_cnt is evaluated using unsigned int
arthithmetic (since these variables are unsigned ints) and hence can never
be less than zero, so the less than comparison is never true.  Rewrite the
expression to check for start_idx being less than dbg_cnt.

After the logic was corrected, temp_idx wasn't working correctly. So fix it
as well.

Link: https://lore.kernel.org/r/20200706204246.130416-1-jsmart2021@gmail.com
Fixes: 372c187b8a ("scsi: lpfc: Add an internal trace log buffer")
CC: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Unsigned compared against 0")
2020-07-08 01:28:49 -04:00
..
lpfc_attr.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
lpfc_attr.h
lpfc_bsg.c scsi: lpfc: Allow applications to issue Common Set Features mailbox command 2020-07-02 23:06:40 -04:00
lpfc_bsg.h scsi: lpfc: Allow applications to issue Common Set Features mailbox command 2020-07-02 23:06:40 -04:00
lpfc_compat.h
lpfc_crtn.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_ct.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_debugfs.c SCSI misc on 20200605 2020-06-05 15:11:50 -07:00
lpfc_debugfs.h scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI 2020-03-29 18:10:58 -04:00
lpfc_disc.h scsi: lpfc: Add NVMe sequence level error recovery support 2019-08-19 22:41:12 -04:00
lpfc_els.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_hbadisc.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_hw4.h scsi: lpfc: Add support to display if adapter dumps are available 2020-07-02 23:06:41 -04:00
lpfc_hw.h scsi: lpfc: Remove prototype FIPS/DSS options from SLI-3 2020-03-29 18:10:58 -04:00
lpfc_ids.h
lpfc_init.c scsi: lpfc: Fix less-than-zero comparison of unsigned value 2020-07-08 01:28:49 -04:00
lpfc_logmsg.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_mbox.c scsi: lpfc: Fix noderef and address space warnings 2020-05-07 22:47:26 -04:00
lpfc_mem.c scsi: lpfc: Fix stack trace seen while setting rrq active 2020-07-02 23:06:37 -04:00
lpfc_nl.h
lpfc_nportdisc.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_nvme.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_nvme.h lpfc: nvmet: Add support for NVME LS request hosthandle 2020-05-09 16:18:34 -06:00
lpfc_nvmet.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_scsi.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_scsi.h scsi: lpfc: Update 12.2.0.0 file copyrights to 2019 2019-02-05 22:29:50 -05:00
lpfc_sli4.h scsi: lpfc: Add blk_io_poll support for latency improvment 2020-07-02 23:06:42 -04:00
lpfc_sli.c scsi: lpfc: Fix inconsistent indenting 2020-07-08 01:14:34 -04:00
lpfc_sli.h scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI 2020-03-29 18:10:58 -04:00
lpfc_version.h scsi: lpfc: Update lpfc version to 12.8.0.2 2020-07-02 23:06:49 -04:00
lpfc_vport.c scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_vport.h
lpfc.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
Makefile