RE: [PATCH 1/1] Drivers: hv: balloon: Fix a memory leak

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

 




> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Thursday, December 13, 2012 4:38 AM
> To: KY Srinivasan
> Cc: gregkh@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> devel@xxxxxxxxxxxxxxxxxxxxxx; olaf@xxxxxxxxx; apw@xxxxxxxxxxxxx;
> jasowang@xxxxxxxxxx
> Subject: Re: [PATCH 1/1] Drivers: hv: balloon: Fix a memory leak
> 
> On Tue, Dec 11, 2012 at 11:07:17AM -0800, K. Y. Srinivasan wrote:
> > -probe_error1:
> > +probe_error2:
> >  	kthread_stop(dm_device.thread);
> >
> > -probe_error0:
> > +probe_error1:
> >  	vmbus_close(dev->channel);
> > +probe_error0:
> > +	kfree(send_buffer);
> 
> If you used labels that describe what the code does instead of
> GW-BASIC labels then you wouldn't need to rename them.
> 
> err_stop_thread:
> 	kthread_stop(dm_device.thread);
> err_close_vmbus:
> 	vmbus_close(dev->channel);
> err_free_send_buf:
> 	kfree(send_buffer);

Thanks Dan. I am not sure how this labeling scheme would work in general where each error
recovery block is a collection of rollback operation. I see your point though.

Regards,

K. Y 
 


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux