Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a238e35b authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

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: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 4a3f15e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment