summaryrefslogtreecommitdiff
path: root/drivers/scsi/stex.c
diff options
context:
space:
mode:
authorJakob Koschel <jkl820.git@gmail.com>2023-03-01 18:19:14 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2023-03-06 18:33:12 -0500
commit2850b23e9f9ae3696e472d2883ea1b43aafa884e (patch)
tree4e18b4d97f38ddd04901eb6502663cefdcbe70e6 /drivers/scsi/stex.c
parent312320b0e0ec21249a17645683fe5304d796aec1 (diff)
downloadlwn-2850b23e9f9ae3696e472d2883ea1b43aafa884e.tar.gz
lwn-2850b23e9f9ae3696e472d2883ea1b43aafa884e.zip
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>
Diffstat (limited to 'drivers/scsi/stex.c')
0 files changed, 0 insertions, 0 deletions