Re: [PATCH] be2iscsi: Fix memory leak in beiscsi_alloc_mem()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 10, 2016 at 11:13:39AM +0100, Maurizio Lombardi wrote:
> ping.
> 
> On 10/01/2015 10:56 AM, Maurizio Lombardi wrote:
> > In case of error, the memory allocated for phwi_ctrlr was not freed.
> > 
> > Signed-off-by: Maurizio Lombardi <mlombard@xxxxxxxxxx>
> > ---
> >  drivers/scsi/be2iscsi/be_main.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> > index 7a6dbfb..360aa88 100644
> > --- a/drivers/scsi/be2iscsi/be_main.c
> > +++ b/drivers/scsi/be2iscsi/be_main.c
> > @@ -2706,8 +2706,10 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba)
> >  	phwi_ctrlr->wrb_context = kzalloc(sizeof(struct hwi_wrb_context) *
> >  					  phba->params.cxns_per_ctrl,
> >  					  GFP_KERNEL);
> > -	if (!phwi_ctrlr->wrb_context)
> > +	if (!phwi_ctrlr->wrb_context) {
> > +		kfree(phba->phwi_ctrlr);
> >  		return -ENOMEM;
> > +	}
> >  
> >  	phba->init_mem = kcalloc(SE_MEM_MAX, sizeof(*mem_descr),
> >  				 GFP_KERNEL);
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Johannes Thumshirn <jthumshirn@xxxxxxx>
-- 
Johannes Thumshirn                                          Storage
jthumshirn@xxxxxxx                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux