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

Skip to content
Commit a270f4a0 authored by Udipto Goswami's avatar Udipto Goswami
Browse files

usb: f_qdss: Avoid wait_for_completion if qdss_disable is called



Commit 3741fb2cfb88 ("coresight: byte-cntr: Free USB requests when
disconnected") introduced a regression which leads qdss_disable &
qdss_close paths to race between them.
If qdss_disable path is processing, it would queue disconnect_work
which will notify the bypass notifier of USB_DISCONNECT and it will
call free_req. Within same time frame if qdss_close is called,
it will try to go ahead dequeue the request and wait_for_completion.
But since free_req got called, it will free the qreq instance which
wait_for_completion uses resulting in kernel panic.

Fix this by checking for ep_dequeue status if dequeue was success
then only wait_for_completion. Also taking the list operation under
qdss->lock in order to avoid any races between qdss_write as well.

Change-Id: I7bf9eab4296a509f5b459fa7768987c4a1f1287f
Signed-off-by: default avatarUdipto Goswami <ugoswami@codeaurora.org>
parent 2a8dfee5
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