soc: qcom: glink_smd_xprt: Fix list access race condition
The channels list for an edge allows a translation from a channel id to
that channel's structure. Channels are added to the list dynamically.
Adding a channel to the list while another context is scanning the list is
unsafe because list_add() is a non-atomic operation that can be reordered
in hardware such that it is possible for a scan operation to follow an
invalid pointer and go off the list.
Protect the list with a lock to ensure that list adds are mutually
exclusive with lsit scans so that scans do not see invalid state.
CRs-Fixed: 870636
Change-Id: I8c6217a31f59000d83b066623771793d1f0251e6
Signed-off-by:
Jeffrey Hugo <jhugo@codeaurora.org>
Loading
Please register or sign in to comment