linux/drivers/scsi/lpfc
Jakob Koschel 2850b23e9f scsi: lpfc: Avoid usage of list iterator variable after loop
If the &epd_pool->list is empty when executing
lpfc_get_io_buf_from_expedite_pool() the function would return an invalid
pointer. Even in the case if the list is guaranteed to be populated, the
iterator variable should not be used after the loop to be more robust for
future changes.

Linus proposed to avoid any use of the list iterator variable after the
loop, in the attempt to move the list iterator variable declaration into
the macro to avoid any potential misuse after the loop [1].

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1]
Signed-off-by: Jakob Koschel <jkl820.git@gmail.com>
Link: https://lore.kernel.org/r/20230301-scsi-lpfc-avoid-list-iterator-after-loop-v1-1-325578ae7561@gmail.com
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-03-06 18:33:12 -05:00
..
lpfc_attr.c scsi: lpfc: Fix double word in comments 2023-02-21 22:00:51 -05:00
lpfc_attr.h
lpfc_bsg.c scsi: lpfc: Fix spelling mistake "unsolicted" -> "unsolicited" 2022-10-01 05:56:24 -04:00
lpfc_bsg.h scsi: lpfc: Copyright updates for 14.2.0.5 patches 2022-07-07 17:21:44 -04:00
lpfc_compat.h
lpfc_crtn.h scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_ct.c scsi: lpfc: Fix spelling mistake "unsolicted" -> "unsolicited" 2022-10-01 05:56:24 -04:00
lpfc_debugfs.c scsi: lpfc: Fix various issues reported by tools 2022-09-15 22:18:28 -04:00
lpfc_debugfs.h scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc_disc.h scsi: lpfc: Fix multiple NVMe remoteport registration calls for the same NPort ID 2022-09-15 22:18:27 -04:00
lpfc_els.c scsi: lpfc: Fix double word in comments 2023-02-21 22:00:51 -05:00
lpfc_hbadisc.c scsi: lpfc: Fix double word in comments 2023-02-21 22:00:51 -05:00
lpfc_hw.h scsi: lpfc: Rework FDMI attribute registration for unintential padding 2022-09-15 22:18:27 -04:00
lpfc_hw4.h scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_ids.h scsi: lpfc: Copyright updates for 14.2.0.5 patches 2022-07-07 17:21:44 -04:00
lpfc_init.c scsi: lpfc: Check kzalloc() in lpfc_sli4_cgn_params_read() 2023-03-06 18:33:12 -05:00
lpfc_logmsg.h scsi: lpfc: Add reporting capability for Link Degrade Signaling 2022-09-15 22:18:27 -04:00
lpfc_mbox.c scsi: lpfc: Fix double word in comments 2023-02-21 22:00:51 -05:00
lpfc_mem.c scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc_nl.h
lpfc_nportdisc.c scsi: lpfc: Fix port stuck in bypassed state after LIP in PT2PT topology 2022-06-07 21:38:18 -04:00
lpfc_nvme.c scsi: lpfc: Fix uninitialized cqe field in lpfc_nvme_cancel_iocb() 2022-07-07 17:21:42 -04:00
lpfc_nvme.h scsi: lpfc: Copyright updates for 14.2.0.0 patches 2022-03-15 13:51:50 -04:00
lpfc_nvmet.c scsi: lpfc: Fix double word in comments 2023-02-21 22:00:51 -05:00
lpfc_scsi.c scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_scsi.h scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc_sli.c scsi: lpfc: Avoid usage of list iterator variable after loop 2023-03-06 18:33:12 -05:00
lpfc_sli.h scsi: lpfc: Remove Menlo/Hornet related code 2022-07-07 17:21:44 -04:00
lpfc_sli4.h scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_version.h scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_vmid.c scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_vport.c scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
lpfc_vport.h scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc.h scsi: lpfc: Copyright updates for 14.2.0.10 patches 2023-01-12 00:03:15 -05:00
Makefile scsi: lpfc: Commonize VMID code location 2022-05-19 20:24:56 -04:00