scsi: lpfc: Fix prli_fc4_req checks in PRLI handling
authorJames Smart <jsmart2021@gmail.com>
Sun, 11 Sep 2022 22:14:53 +0000 (15:14 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 16 Sep 2022 02:18:26 +0000 (22:18 -0400)
commit16ece56986638b8de22f47d009e9b0feec53c031
tree4c97ee8bce02607c1e6bc993d11bdb0bacb32121
parent5ba207e55e7fdfa5f30737d2b234bf5b70fa3bfe
scsi: lpfc: Fix prli_fc4_req checks in PRLI handling

The if statment check (prli_fc4_req & PRLI_NVME_TYPE) evaluates to true
when receiving a PRLI request for bogus FC4 type codes that happen to have
the 3rd or 5th bit set because PRLI_NVME_TYPE is 0x28.  This leads to
sending a PRLI_NVME_ACC even for bogus FC4 type codes.

Change the bitwise & check to an exact == type code check to ensure we send
PRLI_NVME_ACC only for NVME type coded PRLI requests.

Link: https://lore.kernel.org/r/20220911221505.117655-2-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c