Skip to contentSkip to conversation

lpfc: possible memory leak in lpfc_sli4_bsg_diag_loopback_mode()

SCSI Vasily Averin 1 participant 2 messages Jun 6, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

error path after lpfc_sli4_config() failure uses uninitialized variable mbxstatus and can forget to free allocated memory

---
 drivers/scsi/lpfc/lpfc_bsg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/lpfc/lpfc_bsg.c +0 -0
index 7fb0ba4..9620327 100644
@@ -1741,7 +1741,7 @@ lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba,

struct fc_bsg_job *job)
uint32_t link_flags, timeout, req_len, alloc_len; struct lpfc_mbx_set_link_diag_loopback *link_diag_loopback; LPFC_MBOXQ_t *pmboxq = NULL;
- int mbxstatus, i, rc = 0;
+ int mbxstatus = MBX_SUCCESS, i, rc = 0;

/* no data to return just the return code */ job->reply->reply_payload_rcv_len = 0;

Signature · 1 line
1.7.4.1
#1 lore raw

sorry, my thunderbird have corrupted this patch, I'll resend it

Quoted 22 lines · Vasily Averin

error path after lpfc_sli4_config() failure uses uninitialized variable mbxstatus and can forget to free allocated memory

---
 drivers/scsi/lpfc/lpfc_bsg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/lpfc/lpfc_bsg.c +1 -1
index 7fb0ba4..9620327 100644
@@ -1741,7 +1741,7 @@ lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba,
 struct fc_bsg_job *job)
 	uint32_t link_flags, timeout, req_len, alloc_len;
 	struct lpfc_mbx_set_link_diag_loopback *link_diag_loopback;
 	LPFC_MBOXQ_t *pmboxq = NULL;
-	int mbxstatus, i, rc = 0;
+	int mbxstatus = MBX_SUCCESS, i, rc = 0;
 
 	/* no data to return just the return code */

job->reply->reply_payload_rcv_len = 0;