Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1197162 > unrolled thread

[PATCH] lpfc: fix double free on mp

Started byColin King <colin.king@canonical.com>
First post2015-07-31 18:20 +0200
Last post2015-07-31 18:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] lpfc: fix double free on mp Colin King <colin.king@canonical.com> - 2015-07-31 18:20 +0200

#1197162 — [PATCH] lpfc: fix double free on mp

FromColin King <colin.king@canonical.com>
Date2015-07-31 18:20 +0200
Subject[PATCH] lpfc: fix double free on mp
Message-ID<pSlcm-2vJ-7@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

The error path when the call to lpfc_sli_issue_mbox returns
MBX_NOT_FINISHED results in the code freeing mp and calling
lpfc_mbuf_free twice.   Fix this by jumping to the correct
part of the error clean up path.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/lpfc/lpfc_mbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index eb62772..750f34d 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -2299,13 +2299,14 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
 	mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat;
 	mbox->context2 = (struct lpfc_rdp_context *) rdp_context;
 	if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED)
-		goto error;
+		goto cmd_free;
 
 	return;
 
 error:
 	lpfc_mbuf_free(phba, mp->virt, mp->phys);
 	kfree(mp);
+cmd_free:
 	lpfc_sli4_mbox_cmd_free(phba, mbox);
 	rdp_context->cmpl(phba, rdp_context, FAILURE);
 }
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web