Re: [SCSI] lpfc: possible memory leak in lpfc_sli4_bsg_diag_loopback_mode()

Vasily Averin
2011-06-06T16:01:05Z

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

On 06/06/2011 11:30 AM, Vasily Averin wrote:
> error path after lpfc_sli4_config() failure uses uninitialized
> variable mbxstatus and can forget to free allocated memory
>
> Signed-off-by: Vasily Averin <vvs@sw.ru>
> ---
> drivers/scsi/lpfc/lpfc_bsg.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
> index 7fb0ba4..9620327 100644
> --- a/drivers/scsi/lpfc/lpfc_bsg.c
> +++ b/drivers/scsi/lpfc/lpfc_bsg.c
> @@ -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;