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

Skip to content
Commit dde93857 authored by Jack Pham's avatar Jack Pham
Browse files

usb: gadget: diag: fix read/write race with unbind



Prevent against potential race condition when unbind occurs
while a usb_diag_read or usb_diag_write is being issued from
another thread. Do this by keeping a local copy of the in
and out usb_ep pointers, and also by doing a last-chance
equality check between ctxt and the usb_diag_ch priv_usb member
to determine if the connection is still valid. This ensures
that the contents of the ctxt pointer don't get reallocated
when in the midst of an unbind/rebind.

CRs-Fixed: 652651
Change-Id: I75f1dafb4aa688dd068bd58e2c0a72a3c8193d10
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent c82bee2d
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