On Tue, Mar 05, 2013 at 04:40:12PM +0800, Peter Chen wrote: > On Fri, Mar 01, 2013 at 03:42:26PM +0100, Michael Grzeschik wrote: > > Instead of having a limited number of usable tds in the udc we use a > > linked list to support dynamic amount of needed tds for all special > > gadget types. This improves throughput. > > > > This patch also adresses a possible momory leak in _ep_nuke found > > while porting the request handling to an linked list. > > > > - The call of _ep_nuke can lead to an memory leak, if it is called on an > > endpoint with currently dynamic allocated tds. This was aswell a problem > > in the special case before the dynamic td handling was implemented and > > an zero length packet was added to mark the end of the transfer. > > It is another problem, better have another commit, besides, can you > describe more detail? Its possible that we add one extra request to mReq->zptr with dma_pool_alloc in hardware_enqueu, but that one will never be released in ep_nuke. It makes not much sense to move that fix into an extra patch in the first place, as the codepath will be changed by this patch anyway. So i will fix that comment above to be more clear. > > + > > +static int add_td_to_list(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq, unsigned length) > > +{ > > + struct td_node *lastnode, *node = kzalloc(sizeof(struct td_node), GFP_ATOMIC); > > Better split above one line to two lines like below "dma_pool_alloc" I will do that. -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html