usb: gadget: u_smd: Allocate requests in gsmd_connect
Currently we are allocating and freeing requests from start_io
and stop_io respectively. If SMD notifies channel close with
the read requests still queued with the hardware, then with DWC3
gadget the requests are not returned to the read pool and we try
to free the requests from stop_io. But the requests are not
freed leading to extra memory allocation on next start_io.
Fix this by allocating and freeing requests from cable connect
status change i.e. gsmd_connect and gsmd_disconnect respectively.
Also return the requests to read and write pools on unsuccessful
completion, or if requests are pending in read_queue.
Change-Id: I119d03ab14ac7a4f0cea677f0804229f95468d47
Signed-off-by:
Ajay Agarwal <ajaya@codeaurora.org>
Loading
Please register or sign in to comment