]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix gcc -Wstringop-overread warning, again
authorArnd Bergmann <arnd@arndb.de>
Mon, 20 Sep 2021 09:56:22 +0000 (11:56 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Sep 2021 04:16:38 +0000 (00:16 -0400)
commit6c8444aafcdce46d2690563afb1686eebc39760d
tree1e1e5667a78e9ba63efa3b4e28b4ae7838c73720
parentf3dd3341e81f7e9b575f4a4d36bc39f6d59048d9
scsi: lpfc: Fix gcc -Wstringop-overread warning, again

I fixed a stringop-overread warning earlier this year, now a second copy of
the original code was added and the warning came back:

drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_cmf_info_show':
drivers/scsi/lpfc/lpfc_attr.c:289:25: error: 'strnlen' specified bound 4095 exceeds source size 24 [-Werror=stringop-overread]
  289 |                         strnlen(LPFC_INFO_MORE_STR, PAGE_SIZE - 1),
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix it the same way as the other copy.

Link: https://lore.kernel.org/r/20210920095628.1191676-1-arnd@kernel.org
Fixes: 7ecf7a29e986 ("scsi: lpfc: Fix gcc -Wstringop-overread warning")
Fixes: 0200ed49f6e0 ("scsi: lpfc: Add cmf_info sysfs entry")
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_attr.c