usb: ci_udc: fix freeing of ep0 req
authorStephen Warren <swarren@nvidia.com>
Tue, 10 Jun 2014 17:02:36 +0000 (11:02 -0600)
committerMarek Vasut <marex@denx.de>
Wed, 11 Jun 2014 00:26:05 +0000 (02:26 +0200)
commitbdf81611e444e8aef21cb05eeae69f694c0c7a39
tree50a5b14b5f2ba0faf1b37461f7527e9608a375e5
parent43a8f25b6ca77894ddfd46c2b1196c7bd487561f
usb: ci_udc: fix freeing of ep0 req

ci_ep_alloc_request() avoids allocating multiple request objects for ep0
by keeping a record of the first req allocated for ep0, and always
returning that instead of allocating a new req. However, if this req is
ever freed, the record of the previous allocation is not cleared, so
ci_ep_alloc_request() will keep returning this stale pointer. Fix
ci_ep_free_request() to clear the record of the previous allocation.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
drivers/usb/gadget/ci_udc.c