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

Skip to content
Commit 60cc7b92 authored by Mayank Rana's avatar Mayank Rana
Browse files

gadget: u_bam_data: Add protection for possible race condition



bam2bam_data_connect_work() is not protecting port->port_usb data
structure which is also being modified by bam_data_disconnect()
context. Hence if bam2bam_data_connect_work() is being scheduled
and usb cable is being disconnected, bam_data_disconnect() would
change port->port_usb. To fix this race condition, add proper
checks with using previous last event state and using proper locking
in bam2bam_data_connect_work().

Also in case of composition switch, currently pending work are not
being flushed, hence flush bam_data_wq workqueue when particular
configuration is being changed having these functions (qc_ecm/qc_rndis
/mbim).

CRs-Fixed: 718229
Change-Id: I0f4d8d7ca7e6ace151e281d3d8550d799f209bf0
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 8d36a5d0
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