From: Hannes Reinecke <hare@suse.de>
To: James Smart <james.smart@avagotech.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 12/17] lpfc: Fix mbox reuse in PLOGI completion
Date: Thu, 17 Dec 2015 09:32:55 +0100 [thread overview]
Message-ID: <56727337.9000202@suse.de> (raw)
In-Reply-To: <5671efc3.0ctNdaGDOZR2f0ML%james.smart@avagotech.com>
On 12/17/2015 12:12 AM, James Smart wrote:
>
> Fix mbox reuse in PLOGI completion. Moved allocations so that buffer
> properly init'd.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
> Signed-off-by: James Smart <james.smart@avagotech.com>
> ---
> drivers/scsi/lpfc/lpfc_nportdisc.c | 31 +++++++++++++++++++++----------
> 1 file changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
> index 9e571dd..193733e 100644
> --- a/drivers/scsi/lpfc/lpfc_nportdisc.c
> +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
> @@ -1045,16 +1045,6 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
> if (irsp->ulpStatus)
> goto out;
>
> - mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> - if (!mbox) {
> - lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> - "0133 PLOGI: no memory for reg_login "
> - "Data: x%x x%x x%x x%x\n",
> - ndlp->nlp_DID, ndlp->nlp_state,
> - ndlp->nlp_flag, ndlp->nlp_rpi);
> - goto out;
> - }
> -
> pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
>
> prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
> @@ -1118,6 +1108,17 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
> if (phba->sli_rev == LPFC_SLI_REV4) {
> lpfc_issue_reg_vfi(vport);
> } else {
> + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + if (!mbox) {
> + lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> + "0133 PLOGI: no memory "
> + "for config_link "
> + "Data: x%x x%x x%x x%x\n",
> + ndlp->nlp_DID, ndlp->nlp_state,
> + ndlp->nlp_flag, ndlp->nlp_rpi);
> + goto out;
> + }
> +
> lpfc_config_link(phba, mbox);
>
> mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
> @@ -1132,6 +1133,16 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
>
> lpfc_unreg_rpi(vport, ndlp);
>
> + mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + if (!mbox) {
> + lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
> + "0018 PLOGI: no memory for reg_login "
> + "Data: x%x x%x x%x x%x\n",
> + ndlp->nlp_DID, ndlp->nlp_state,
> + ndlp->nlp_flag, ndlp->nlp_rpi);
> + goto out;
> + }
> +
> if (lpfc_reg_rpi(phba, vport->vpi, irsp->un.elsreq64.remoteID,
> (uint8_t *) sp, mbox, ndlp->nlp_rpi) == 0) {
> switch (ndlp->nlp_DID) {
>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-12-17 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 23:12 [PATCH 12/17] lpfc: Fix mbox reuse in PLOGI completion James Smart
2015-12-17 8:32 ` Hannes Reinecke [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56727337.9000202@suse.de \
--to=hare@suse.de \
--cc=james.smart@avagotech.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).