Re: [PATCH] scsi: lpfc: avoid usage of list iterator variable after loop
From: Martin K. Petersen
Date: Mon Mar 06 2023 - 21:57:51 EST
On Wed, 01 Mar 2023 18:19:14 +0100, Jakob Koschel wrote:
> 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 marcro to avoid any potential misuse after the loop [1].
>
> [...]
Applied to 6.3/scsi-fixes, thanks!
[1/1] scsi: lpfc: avoid usage of list iterator variable after loop
https://git.kernel.org/mkp/scsi/c/2850b23e9f9a
--
Martin K. Petersen Oracle Linux Engineering