mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 08:58:07 +00:00
4410a67a9e
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> |
||
---|---|---|
.. | ||
lpfc.h | ||
lpfc_attr.c | ||
lpfc_attr.h | ||
lpfc_bsg.c | ||
lpfc_bsg.h | ||
lpfc_compat.h | ||
lpfc_crtn.h | ||
lpfc_ct.c | ||
lpfc_debugfs.c | ||
lpfc_debugfs.h | ||
lpfc_disc.h | ||
lpfc_els.c | ||
lpfc_hbadisc.c | ||
lpfc_hw.h | ||
lpfc_hw4.h | ||
lpfc_ids.h | ||
lpfc_init.c | ||
lpfc_logmsg.h | ||
lpfc_mbox.c | ||
lpfc_mem.c | ||
lpfc_nl.h | ||
lpfc_nportdisc.c | ||
lpfc_nvme.c | ||
lpfc_nvme.h | ||
lpfc_nvmet.c | ||
lpfc_nvmet.h | ||
lpfc_scsi.c | ||
lpfc_scsi.h | ||
lpfc_sli.c | ||
lpfc_sli.h | ||
lpfc_sli4.h | ||
lpfc_version.h | ||
lpfc_vport.c | ||
lpfc_vport.h | ||
Makefile |