msm: mhi_dev: Redesign UCI transfer request structure management
Invalid memory access can happen if a client closes its channels
with transfers pending because the mhi transfer request structure
gets freed in UCI when channel is closed, but MHI driver accesses the
request structure in the transfer completion callback.
To avoid the invalid memory access, following changes are done:
* Allocate mhi transfer request structures for a client in the
first UCI client open call
* Do not free mhi transfer request structs when client calls release,
to allow for subsequent re-use
* Maintain an in-use list to track active transfers
* If a client exits with transfers pending, move the request structs
corresponding to pending transfers to free list and mark them as
stale.
* Stale transfers, if completed later, are ignored.
Change-Id: I170e06321de9c67b0a1d107b775d75b2ed97febb
Signed-off-by:
Siva Kumar Akkireddi <sivaa@codeaurora.org>
Signed-off-by:
Gauri Joshi <gaurjosh@codeaurora.org>
Loading
Please register or sign in to comment