diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-06-14 22:52:59 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 09:22:28 -0400 |
commit | 495a714c50e2c6ca6357129812f983b3ac0a32f2 (patch) | |
tree | f4f7237ed2bcb5e35c9dacae60864d169303b6b4 | |
parent | 5e9d9b8276980fc5dfa88ce34f6ec88ce3026232 (diff) |
[SCSI] lpfc 8.2.7 : Miscellaneous Fixes
Miscellaneous Fixes:
- Fix bug in mbox sysfs interface that locked in EAGAIN if discovery stalled.
- Fix missing error message when npiv and loop are true when link up occurs.
- Fix panic in lpfc_scsi_cmd_iocb_cmpl: scsi_buf was NULL, but created
race conditions with other code paths.
- Fix error in sysfs mailbox structure that didn't rezero on next use.
- Add missing mempool_free() to attachment failure path
- Fix missing put of ndlp structure during driver unload.
- Fix applications unable to send mailbox commands during discovery.
- Remove unused argument (type) from function lpfc_post_buffer() API
- Fix vport name is not shown after hbacmd vportcreate.
- Remove repeated code statements.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 3 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_crtn.h | 3 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 6 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 7 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 18 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 5 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 13 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_vport.c | 16 |
10 files changed, 51 insertions, 25 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index e3e5b540e36c..e0e018d12653 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -33,6 +33,7 @@ struct lpfc_sli2_slim; | |||
33 | #define LPFC_MAX_SG_SEG_CNT 256 /* sg element count per scsi cmnd */ | 33 | #define LPFC_MAX_SG_SEG_CNT 256 /* sg element count per scsi cmnd */ |
34 | #define LPFC_IOCB_LIST_CNT 2250 /* list of IOCBs for fast-path usage. */ | 34 | #define LPFC_IOCB_LIST_CNT 2250 /* list of IOCBs for fast-path usage. */ |
35 | #define LPFC_Q_RAMP_UP_INTERVAL 120 /* lun q_depth ramp up interval */ | 35 | #define LPFC_Q_RAMP_UP_INTERVAL 120 /* lun q_depth ramp up interval */ |
36 | #define LPFC_VNAME_LEN 100 /* vport symbolic name length */ | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * Following time intervals are used of adjusting SCSI device | 39 | * Following time intervals are used of adjusting SCSI device |
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 960baaf11fb1..37bfa0bd1dae 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -1995,8 +1995,7 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
1995 | /* Don't allow mailbox commands to be sent when blocked | 1995 | /* Don't allow mailbox commands to be sent when blocked |
1996 | * or when in the middle of discovery | 1996 | * or when in the middle of discovery |
1997 | */ | 1997 | */ |
1998 | if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO || | 1998 | if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) { |
1999 | vport->fc_flag & FC_NDISC_ACTIVE) { | ||
2000 | sysfs_mbox_idle(phba); | 1999 | sysfs_mbox_idle(phba); |
2001 | spin_unlock_irq(&phba->hbalock); | 2000 | spin_unlock_irq(&phba->hbalock); |
2002 | return -EAGAIN; | 2001 | return -EAGAIN; |
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index 7c9f8317d972..1b8245213b83 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h | |||
@@ -142,7 +142,7 @@ int lpfc_config_port_post(struct lpfc_hba *); | |||
142 | int lpfc_hba_down_prep(struct lpfc_hba *); | 142 | int lpfc_hba_down_prep(struct lpfc_hba *); |
143 | int lpfc_hba_down_post(struct lpfc_hba *); | 143 | int lpfc_hba_down_post(struct lpfc_hba *); |
144 | void lpfc_hba_init(struct lpfc_hba *, uint32_t *); | 144 | void lpfc_hba_init(struct lpfc_hba *, uint32_t *); |
145 | int lpfc_post_buffer(struct lpfc_hba *, struct lpfc_sli_ring *, int, int); | 145 | int lpfc_post_buffer(struct lpfc_hba *, struct lpfc_sli_ring *, int); |
146 | void lpfc_decode_firmware_rev(struct lpfc_hba *, char *, int); | 146 | void lpfc_decode_firmware_rev(struct lpfc_hba *, char *, int); |
147 | int lpfc_online(struct lpfc_hba *); | 147 | int lpfc_online(struct lpfc_hba *); |
148 | void lpfc_unblock_mgmt_io(struct lpfc_hba *); | 148 | void lpfc_unblock_mgmt_io(struct lpfc_hba *); |
@@ -263,6 +263,7 @@ extern int lpfc_sli_mode; | |||
263 | extern int lpfc_enable_npiv; | 263 | extern int lpfc_enable_npiv; |
264 | 264 | ||
265 | int lpfc_vport_symbolic_node_name(struct lpfc_vport *, char *, size_t); | 265 | int lpfc_vport_symbolic_node_name(struct lpfc_vport *, char *, size_t); |
266 | int lpfc_vport_symbolic_port_name(struct lpfc_vport *, char *, size_t); | ||
266 | void lpfc_terminate_rport_io(struct fc_rport *); | 267 | void lpfc_terminate_rport_io(struct fc_rport *); |
267 | void lpfc_dev_loss_tmo_callbk(struct fc_rport *rport); | 268 | void lpfc_dev_loss_tmo_callbk(struct fc_rport *rport); |
268 | 269 | ||
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 5442ce33615a..7fc74cf5823b 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -101,7 +101,7 @@ lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
101 | /* Not enough posted buffers; Try posting more buffers */ | 101 | /* Not enough posted buffers; Try posting more buffers */ |
102 | phba->fc_stat.NoRcvBuf++; | 102 | phba->fc_stat.NoRcvBuf++; |
103 | if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) | 103 | if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) |
104 | lpfc_post_buffer(phba, pring, 2, 1); | 104 | lpfc_post_buffer(phba, pring, 2); |
105 | return; | 105 | return; |
106 | } | 106 | } |
107 | 107 | ||
@@ -151,7 +151,7 @@ lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
151 | } | 151 | } |
152 | list_del(&iocbq->list); | 152 | list_del(&iocbq->list); |
153 | lpfc_sli_release_iocbq(phba, iocbq); | 153 | lpfc_sli_release_iocbq(phba, iocbq); |
154 | lpfc_post_buffer(phba, pring, i, 1); | 154 | lpfc_post_buffer(phba, pring, i); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | } | 157 | } |
@@ -990,7 +990,7 @@ lpfc_cmpl_ct_cmd_rff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
990 | return; | 990 | return; |
991 | } | 991 | } |
992 | 992 | ||
993 | static int | 993 | int |
994 | lpfc_vport_symbolic_port_name(struct lpfc_vport *vport, char *symbol, | 994 | lpfc_vport_symbolic_port_name(struct lpfc_vport *vport, char *symbol, |
995 | size_t size) | 995 | size_t size) |
996 | { | 996 | { |
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 5d69dee85a8d..f54e0f7eaee3 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -3857,9 +3857,6 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport) | |||
3857 | els_command == ELS_CMD_FDISC) | 3857 | els_command == ELS_CMD_FDISC) |
3858 | continue; | 3858 | continue; |
3859 | 3859 | ||
3860 | if (vport != piocb->vport) | ||
3861 | continue; | ||
3862 | |||
3863 | if (piocb->drvrTimeout > 0) { | 3860 | if (piocb->drvrTimeout > 0) { |
3864 | if (piocb->drvrTimeout >= timeout) | 3861 | if (piocb->drvrTimeout >= timeout) |
3865 | piocb->drvrTimeout -= timeout; | 3862 | piocb->drvrTimeout -= timeout; |
@@ -4013,7 +4010,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
4013 | payload = ((struct lpfc_dmabuf *)elsiocb->context2)->virt; | 4010 | payload = ((struct lpfc_dmabuf *)elsiocb->context2)->virt; |
4014 | cmd = *payload; | 4011 | cmd = *payload; |
4015 | if ((phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) == 0) | 4012 | if ((phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) == 0) |
4016 | lpfc_post_buffer(phba, pring, 1, 1); | 4013 | lpfc_post_buffer(phba, pring, 1); |
4017 | 4014 | ||
4018 | did = icmd->un.rcvels.remoteID; | 4015 | did = icmd->un.rcvels.remoteID; |
4019 | if (icmd->ulpStatus) { | 4016 | if (icmd->ulpStatus) { |
@@ -4322,7 +4319,7 @@ lpfc_els_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
4322 | phba->fc_stat.NoRcvBuf++; | 4319 | phba->fc_stat.NoRcvBuf++; |
4323 | /* Not enough posted buffers; Try posting more buffers */ | 4320 | /* Not enough posted buffers; Try posting more buffers */ |
4324 | if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) | 4321 | if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) |
4325 | lpfc_post_buffer(phba, pring, 0, 1); | 4322 | lpfc_post_buffer(phba, pring, 0); |
4326 | return; | 4323 | return; |
4327 | } | 4324 | } |
4328 | 4325 | ||
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index ba4873c9e2c3..a98d11bf3576 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -917,6 +917,10 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) | |||
917 | if (phba->fc_topology == TOPOLOGY_LOOP) { | 917 | if (phba->fc_topology == TOPOLOGY_LOOP) { |
918 | phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED; | 918 | phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED; |
919 | 919 | ||
920 | if (phba->cfg_enable_npiv) | ||
921 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | ||
922 | "1309 Link Up Event npiv not supported in loop " | ||
923 | "topology\n"); | ||
920 | /* Get Loop Map information */ | 924 | /* Get Loop Map information */ |
921 | if (la->il) | 925 | if (la->il) |
922 | vport->fc_flag |= FC_LBIT; | 926 | vport->fc_flag |= FC_LBIT; |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 53cedbafffba..5b6e5395c8eb 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -145,8 +145,10 @@ lpfc_config_port_prep(struct lpfc_hba *phba) | |||
145 | return -ERESTART; | 145 | return -ERESTART; |
146 | } | 146 | } |
147 | 147 | ||
148 | if (phba->sli_rev == 3 && !mb->un.varRdRev.v3rsp) | 148 | if (phba->sli_rev == 3 && !mb->un.varRdRev.v3rsp) { |
149 | mempool_free(pmb, phba->mbox_mem_pool); | ||
149 | return -EINVAL; | 150 | return -EINVAL; |
151 | } | ||
150 | 152 | ||
151 | /* Save information as VPD data */ | 153 | /* Save information as VPD data */ |
152 | vp->rev.rBit = 1; | 154 | vp->rev.rBit = 1; |
@@ -1197,8 +1199,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1197 | /* Returns the number of buffers NOT posted. */ | 1199 | /* Returns the number of buffers NOT posted. */ |
1198 | /**************************************************/ | 1200 | /**************************************************/ |
1199 | int | 1201 | int |
1200 | lpfc_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cnt, | 1202 | lpfc_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cnt) |
1201 | int type) | ||
1202 | { | 1203 | { |
1203 | IOCB_t *icmd; | 1204 | IOCB_t *icmd; |
1204 | struct lpfc_iocbq *iocb; | 1205 | struct lpfc_iocbq *iocb; |
@@ -1298,7 +1299,7 @@ lpfc_post_rcv_buf(struct lpfc_hba *phba) | |||
1298 | struct lpfc_sli *psli = &phba->sli; | 1299 | struct lpfc_sli *psli = &phba->sli; |
1299 | 1300 | ||
1300 | /* Ring 0, ELS / CT buffers */ | 1301 | /* Ring 0, ELS / CT buffers */ |
1301 | lpfc_post_buffer(phba, &psli->ring[LPFC_ELS_RING], LPFC_BUF_RING0, 1); | 1302 | lpfc_post_buffer(phba, &psli->ring[LPFC_ELS_RING], LPFC_BUF_RING0); |
1302 | /* Ring 2 - FCP no buffers needed */ | 1303 | /* Ring 2 - FCP no buffers needed */ |
1303 | 1304 | ||
1304 | return 0; | 1305 | return 0; |
@@ -1457,6 +1458,15 @@ lpfc_cleanup(struct lpfc_vport *vport) | |||
1457 | 1458 | ||
1458 | lpfc_disc_state_machine(vport, ndlp, NULL, | 1459 | lpfc_disc_state_machine(vport, ndlp, NULL, |
1459 | NLP_EVT_DEVICE_RM); | 1460 | NLP_EVT_DEVICE_RM); |
1461 | |||
1462 | /* nlp_type zero is not defined, nlp_flag zero also not defined, | ||
1463 | * nlp_state is unused, this happens when | ||
1464 | * an initiator has logged | ||
1465 | * into us so cleanup this ndlp. | ||
1466 | */ | ||
1467 | if ((ndlp->nlp_type == 0) && (ndlp->nlp_flag == 0) && | ||
1468 | (ndlp->nlp_state == 0)) | ||
1469 | lpfc_nlp_put(ndlp); | ||
1460 | } | 1470 | } |
1461 | 1471 | ||
1462 | /* At this point, ALL ndlp's should be gone | 1472 | /* At this point, ALL ndlp's should be gone |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 1e88b7a8a451..c94da4f2b8a6 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -605,9 +605,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
605 | result = cmd->result; | 605 | result = cmd->result; |
606 | sdev = cmd->device; | 606 | sdev = cmd->device; |
607 | lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); | 607 | lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); |
608 | spin_lock_irqsave(sdev->host->host_lock, flags); | ||
609 | lpfc_cmd->pCmd = NULL; /* This must be done before scsi_done */ | ||
610 | spin_unlock_irqrestore(sdev->host->host_lock, flags); | ||
611 | cmd->scsi_done(cmd); | 608 | cmd->scsi_done(cmd); |
612 | 609 | ||
613 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { | 610 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { |
@@ -616,6 +613,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
616 | * wake up the thread. | 613 | * wake up the thread. |
617 | */ | 614 | */ |
618 | spin_lock_irqsave(sdev->host->host_lock, flags); | 615 | spin_lock_irqsave(sdev->host->host_lock, flags); |
616 | lpfc_cmd->pCmd = NULL; | ||
619 | if (lpfc_cmd->waitq) | 617 | if (lpfc_cmd->waitq) |
620 | wake_up(lpfc_cmd->waitq); | 618 | wake_up(lpfc_cmd->waitq); |
621 | spin_unlock_irqrestore(sdev->host->host_lock, flags); | 619 | spin_unlock_irqrestore(sdev->host->host_lock, flags); |
@@ -686,6 +684,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
686 | * wake up the thread. | 684 | * wake up the thread. |
687 | */ | 685 | */ |
688 | spin_lock_irqsave(sdev->host->host_lock, flags); | 686 | spin_lock_irqsave(sdev->host->host_lock, flags); |
687 | lpfc_cmd->pCmd = NULL; | ||
689 | if (lpfc_cmd->waitq) | 688 | if (lpfc_cmd->waitq) |
690 | wake_up(lpfc_cmd->waitq); | 689 | wake_up(lpfc_cmd->waitq); |
691 | spin_unlock_irqrestore(sdev->host->host_lock, flags); | 690 | spin_unlock_irqrestore(sdev->host->host_lock, flags); |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 3dba3a967ed1..f40aa7b905f7 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -3763,7 +3763,6 @@ lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, struct lpfc_vport *vport, | |||
3763 | lpfc_ctx_cmd ctx_cmd) | 3763 | lpfc_ctx_cmd ctx_cmd) |
3764 | { | 3764 | { |
3765 | struct lpfc_scsi_buf *lpfc_cmd; | 3765 | struct lpfc_scsi_buf *lpfc_cmd; |
3766 | struct scsi_cmnd *cmnd; | ||
3767 | int rc = 1; | 3766 | int rc = 1; |
3768 | 3767 | ||
3769 | if (!(iocbq->iocb_flag & LPFC_IO_FCP)) | 3768 | if (!(iocbq->iocb_flag & LPFC_IO_FCP)) |
@@ -3773,19 +3772,20 @@ lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, struct lpfc_vport *vport, | |||
3773 | return rc; | 3772 | return rc; |
3774 | 3773 | ||
3775 | lpfc_cmd = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq); | 3774 | lpfc_cmd = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq); |
3776 | cmnd = lpfc_cmd->pCmd; | ||
3777 | 3775 | ||
3778 | if (cmnd == NULL) | 3776 | if (lpfc_cmd->pCmd == NULL) |
3779 | return rc; | 3777 | return rc; |
3780 | 3778 | ||
3781 | switch (ctx_cmd) { | 3779 | switch (ctx_cmd) { |
3782 | case LPFC_CTX_LUN: | 3780 | case LPFC_CTX_LUN: |
3783 | if ((cmnd->device->id == tgt_id) && | 3781 | if ((lpfc_cmd->rdata->pnode) && |
3784 | (cmnd->device->lun == lun_id)) | 3782 | (lpfc_cmd->rdata->pnode->nlp_sid == tgt_id) && |
3783 | (scsilun_to_int(&lpfc_cmd->fcp_cmnd->fcp_lun) == lun_id)) | ||
3785 | rc = 0; | 3784 | rc = 0; |
3786 | break; | 3785 | break; |
3787 | case LPFC_CTX_TGT: | 3786 | case LPFC_CTX_TGT: |
3788 | if (cmnd->device->id == tgt_id) | 3787 | if ((lpfc_cmd->rdata->pnode) && |
3788 | (lpfc_cmd->rdata->pnode->nlp_sid == tgt_id)) | ||
3789 | rc = 0; | 3789 | rc = 0; |
3790 | break; | 3790 | break; |
3791 | case LPFC_CTX_HOST: | 3791 | case LPFC_CTX_HOST: |
@@ -3995,6 +3995,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, | |||
3995 | if (pmboxq->context1) | 3995 | if (pmboxq->context1) |
3996 | return MBX_NOT_FINISHED; | 3996 | return MBX_NOT_FINISHED; |
3997 | 3997 | ||
3998 | pmboxq->mbox_flag &= ~LPFC_MBX_WAKE; | ||
3998 | /* setup wake call as IOCB callback */ | 3999 | /* setup wake call as IOCB callback */ |
3999 | pmboxq->mbox_cmpl = lpfc_sli_wake_mbox_wait; | 4000 | pmboxq->mbox_cmpl = lpfc_sli_wake_mbox_wait; |
4000 | /* setup context field to pass wait_queue pointer to wake function */ | 4001 | /* setup context field to pass wait_queue pointer to wake function */ |
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 6feaf59b0b1b..109f89d98830 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c | |||
@@ -216,6 +216,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
216 | int vpi; | 216 | int vpi; |
217 | int rc = VPORT_ERROR; | 217 | int rc = VPORT_ERROR; |
218 | int status; | 218 | int status; |
219 | int size; | ||
219 | 220 | ||
220 | if ((phba->sli_rev < 3) || | 221 | if ((phba->sli_rev < 3) || |
221 | !(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { | 222 | !(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { |
@@ -278,7 +279,20 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
278 | 279 | ||
279 | memcpy(vport->fc_portname.u.wwn, vport->fc_sparam.portName.u.wwn, 8); | 280 | memcpy(vport->fc_portname.u.wwn, vport->fc_sparam.portName.u.wwn, 8); |
280 | memcpy(vport->fc_nodename.u.wwn, vport->fc_sparam.nodeName.u.wwn, 8); | 281 | memcpy(vport->fc_nodename.u.wwn, vport->fc_sparam.nodeName.u.wwn, 8); |
281 | 282 | size = strnlen(fc_vport->symbolic_name, LPFC_VNAME_LEN); | |
283 | if (size) { | ||
284 | vport->vname = kzalloc(size+1, GFP_KERNEL); | ||
285 | if (!vport->vname) { | ||
286 | lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, | ||
287 | "1814 Create VPORT failed. " | ||
288 | "vname allocation failed.\n"); | ||
289 | rc = VPORT_ERROR; | ||
290 | lpfc_free_vpi(phba, vpi); | ||
291 | destroy_port(vport); | ||
292 | goto error_out; | ||
293 | } | ||
294 | memcpy(vport->vname, fc_vport->symbolic_name, size+1); | ||
295 | } | ||
282 | if (fc_vport->node_name != 0) | 296 | if (fc_vport->node_name != 0) |
283 | u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn); | 297 | u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn); |
284 | if (fc_vport->port_name != 0) | 298 | if (fc_vport->port_name != 0) |