scsi: libfc: Correct the condition check and invalid argument passed
authorJaved Hasan <jhasan@marvell.com>
Thu, 3 Jun 2021 10:14:04 +0000 (03:14 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 10 Jun 2021 03:55:38 +0000 (23:55 -0400)
commit8f70328c068f9f5c5db82848724cb276f657b9cd
treef731f01cb4919e718c5b3b195b4e41b8626a4112
parent40445fd2c9fa427297acdfcc2c573ff10493f209
scsi: libfc: Correct the condition check and invalid argument passed

Incorrect condition check was leading to data corruption.

Link: https://lore.kernel.org/r/20210603101404.7841-3-jhasan@marvell.com
Fixes: 8fd9efca86d0 ("scsi: libfc: Work around -Warray-bounds warning")
CC: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_encode.h