scsi: lpfc: Fix oops if nvmet_fc_register_targetport fails
authorDick Kennedy <dick.kennedy@broadcom.com>
Sat, 30 Sep 2017 00:34:39 +0000 (17:34 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 3 Oct 2017 02:46:38 +0000 (22:46 -0400)
commite7981a2c725f8e237f749fa1358997707d57e32c
tree690cf3b5227160738ce29be79867865a8471f0f7
parentcf4c8c861074af050b51f00cac44b24195b2d0d3
scsi: lpfc: Fix oops if nvmet_fc_register_targetport fails

if nvmet targetport registration fails, the driver encounters a NULL
pointer oops in lpfc_hb_timeout_handler.

To fix: if registration fails, ensure nvmet_support is cleared on the
port structure.

Also enhanced the log message on failure.

Cc: <stable@vger.kernel.org> # 4.12+
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nvmet.c