linux-stable/drivers/scsi/lpfc
James Smart 4410a67a9e Fix nvme initiator handling when not enabled.
Fix nvme initiator handline when CONFIG_LPFC_NVME_INITIATOR is not enabled.

With update nvme upstream driver sources, loading
the driver with nvme enabled resulting in this Oops.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
 IP: lpfc_nvme_update_localport+0x23/0xd0 [lpfc]
 PGD 0
 Oops: 0000 [#1] SMP
 CPU: 0 PID: 10256 Comm: lpfc_worker_0 Tainted
 Hardware name: ...
 task: ffff881028191c40 task.stack: ffff880ffdf00000
 RIP: 0010:lpfc_nvme_update_localport+0x23/0xd0 [lpfc]
 RSP: 0018:ffff880ffdf03c20 EFLAGS: 00010202

Cause: As the initiator driver completes discovery at different stages,
it call lpfc_nvme_update_localport to hint that the DID and role may have
changed.  In the implementation of lpfc_nvme_update_localport, the driver
was not validating the localport or the lport during the execution
of the update_localport routine.  With the recent upstream additions to
the driver, the create_localport routine didn't run and so the localport
was NULL causing the page-fault Oops.

Fix: Add the CONFIG_LPFC_NVME_INITIATOR preprocessor inclusions to
lpfc_nvme_update_localport to turn off all routine processing when
the running kernel does not have NVME configured.  Add NULL pointer
checks on the localport and lport in lpfc_nvme_update_localport and
dump messages if they are NULL and just exit.
Also one alingment issue fixed.
Repalces the ifdef with the IS_ENABLED macro.

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>
2017-04-24 09:25:48 +02:00
..
lpfc.h scsi: lpfc: code cleanups in NVME initiator base 2017-03-06 23:04:23 -05:00
lpfc_attr.c Fix nvme initiator handling when not enabled. 2017-04-24 09:25:48 +02:00
lpfc_attr.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_bsg.c scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_bsg.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_compat.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_crtn.h scsi: lpfc: Fix eh_deadline setting for sli3 adapters. 2017-03-06 23:04:22 -05:00
lpfc_ct.c scsi: lpfc: code cleanups in NVME initiator discovery 2017-03-06 23:04:23 -05:00
lpfc_debugfs.c Fix extra line print in rqpair debug print. 2017-04-24 09:25:48 +02:00
lpfc_debugfs.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_disc.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_els.c Fix PRLI ACC rsp for NVME 2017-04-24 09:25:48 +02:00
lpfc_hbadisc.c scsi: lpfc: code cleanups in NVME initiator base 2017-03-06 23:04:23 -05:00
lpfc_hw.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_hw4.h scsi: lpfc: Rename LPFC_MAX_EQ_DELAY to LPFC_MAX_EQ_DELAY_EQID_CNT 2017-03-06 23:04:22 -05:00
lpfc_ids.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_init.c Fix driver unload/reload operation. 2017-04-24 09:25:48 +02:00
lpfc_logmsg.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_mbox.c scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_mem.c scsi: lpfc: don't dereference dma_buf->iocbq before null check 2017-03-06 23:04:22 -05:00
lpfc_nl.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_nportdisc.c scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_nvme.c Fix nvme initiator handling when not enabled. 2017-04-24 09:25:48 +02:00
lpfc_nvme.h Remove unused defines for NVME PostBuf. 2017-04-24 09:25:48 +02:00
lpfc_nvmet.c Standardize nvme SGL segment count 2017-04-24 09:25:48 +02:00
lpfc_nvmet.h Standardize nvme SGL segment count 2017-04-24 09:25:48 +02:00
lpfc_scsi.c scsi: lpfc: add transport eh_timed_out reference 2017-03-06 23:04:22 -05:00
lpfc_scsi.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_sli.c Fix driver usage of 128B WQEs when WQ_CREATE is V1. 2017-04-24 09:25:48 +02:00
lpfc_sli.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
lpfc_sli4.h scsi: lpfc: add NVME exchange aborts 2017-03-06 23:04:22 -05:00
lpfc_version.h scsi: lpfc: revise version number to 11.2.0.10 2017-03-06 23:04:23 -05:00
lpfc_vport.c SCSI misc on 20170303 2017-03-03 21:36:56 -08:00
lpfc_vport.h scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00
Makefile scsi: lpfc: Update copyrights 2017-02-22 18:41:44 -05:00