From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasily Averin Subject: Re: [SCSI] lpfc: possible memory leak in lpfc_sli4_bsg_diag_loopback_mode() Date: Mon, 06 Jun 2011 20:00:56 +0400 Message-ID: <4DECF9B8.90805@parallels.com> References: <4DEC821F.8080409@parallels.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:22231 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752774Ab1FFQBF (ORCPT ); Mon, 6 Jun 2011 12:01:05 -0400 In-Reply-To: <4DEC821F.8080409@parallels.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org Cc: linux-scsi@vger.kernel.org, James Smart , James Bottomley 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 > --- > 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;