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

Skip to content
Commit 8757d5ff authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Chris Lew
Browse files

net: qrtr: Make qrtr_port_lookup() use RCU



The important part of qrtr_port_lookup() wrt synchronization is that the
function returns a reference counted struct qrtr_sock, or fail.

As such we need only to ensure that an decrement of the object's
refcount happens inbetween the finding of the object in the idr and
qrtr_port_lookup()'s own increment of the object.

By using RCU and putting a synchronization point after we remove the
mapping from the idr, but before it can be released we achieve this -
with the benefit of not having to hold the mutex in qrtr_port_lookup().

Change-Id: Ia9907a9c97a29e92a92e67afa988207f501a2f48
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Patch-mainline: linux-arm-kernel @ 07/05/19, 23:06
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 83e68efe
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