lpfc: Fix pointer checks and comments in LS receive refactoring
authorJames Smart <jsmart2021@gmail.com>
Wed, 20 May 2020 18:59:27 +0000 (11:59 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 27 May 2020 05:12:40 +0000 (07:12 +0200)
commitfcdd14b86f6b891b5e894bf1dbeaf02cc79bdbce
tree904247666157694a3241df76dbcb7eaed41070c0
parent3b2a1ebceba3e03b17ef0970bb7757a3a64cdc8b
lpfc: Fix pointer checks and comments in LS receive refactoring

Additional testing encountered null pointers that weren't fully qualified
in lpfc_nvmet_xmt_ls_abort_cmp() and lpfc_nvmet_unsol_issue_abort().

The same error was detected and reported by static checker reporting:
  drivers/scsi/lpfc/lpfc_sli.c:2905 lpfc_nvme_unsol_ls_handler()
  error: we previously assumed 'phba->targetport' could be null
    (see line 2837)

Fix by making phba->nvmet_support and phba->targetport validity checks
in lpfc_nvmet_xmt_ls_abort_cmp() and lpfc_nvmet_unsol_issue_abort().

Fixes: 3a8070c567aaa (“lpfc: Refactor NVME LS receive handling”)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul Ely <paul.ely@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/lpfc/lpfc_nvmet.c