lpfc: possible memory leak in lpfc_sli4_bsg_diag_loopback_mode()
Subsystems (2)
error path after lpfc_sli4_config() failure uses uninitialized variable mbxstatus and can forget to free allocated memory
Signed-off-by Vasily Averin <[email protected]>
--- drivers/scsi/lpfc/lpfc_bsg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/lpfc/lpfc_bsg.c +0 -0
@@ -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
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 memorySigned-off-by Vasily Averin <[email protected]>--- drivers/scsi/lpfc/lpfc_bsg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/scsi/lpfc/lpfc_bsg.c +1
-1@@ -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;