usb: u_bam: Free endpoint request buffer on disconnect

Some controller drivers (e.g. DWC3) keep a mapping between USB
request and its corresponding endpoint on request allocation.
This is later used by DCD when request is queued.
During USB disconnect, u_bam disables IN ep and adds the request
back to tx_idle pool instead of freeing it. This USB request in
idle pool may point to invalid EP if composition switch happens
resulting in u_bam's IN EP getting assigned to some other function.
Later when u_bam tries to enqueue this request again, DCD may queue
to the old EP now used by some other function. Fix this by freeing
usb_request on disconnect.

Change-Id: I0f18a8c85fce636bab4bb4e5bb7e85365339f2a9
CRs-Fixed: 468071
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
1 file changed