On Sunday 27 November 2005 12:23, Alan Stern wrote: > Today 12:23:33 > > On Sun, 27 Nov 2005, Ville Syrjälä wrote: > > > > I suspect you are triggering a bug in the input layer. Adding a few > > > debugging lines to the test driver, particularly in usbtest_delete, might > > > help pinpoint the bug. > > > > It explodes when I call input_free_device() which just a wrapper for > > kfree(). And now I see the reason for the double free. > > input_dev_release() also does kfree() on the input_dev. > > > > So the question is: Why does input_free_device() even exist? > > You should ask Dmitry Torokhov (CC'ed). >
input_free_device() is supposed to be called after input_alloc_device() if ->probe() function fails before calling input_register_device() or if input_register_device() fails. The reason there is input_free_device() instead of just using kfree() is because down the road input_allocate_device() may start doing something more and simple kfree() will not be enough. -- Dmitry ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel