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

Commit 01877e30 authored by Chris Lew's avatar Chris Lew
Browse files

net: qrtr: Use lock while looking up tx flow



Flow structs are freed under the qrtr_tx_lock. Make sure all accesses
to the flow radix tree are protected by the qrtr_tx_lock.

Change-Id: I1574a09079e80ca9df255eaf9a8b3e5368b26305
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 01dafb76
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -400,11 +400,13 @@ static void qrtr_tx_resume(struct qrtr_node *node, struct sk_buff *skb)
	src.sq_port = le32_to_cpu(pkt.client.port);
	key = (u64)src.sq_node << 32 | src.sq_port;

	mutex_lock(&node->qrtr_tx_lock);
	flow = radix_tree_lookup(&node->qrtr_tx_flow, key);
	if (!flow)
	if (!flow) {
		mutex_unlock(&node->qrtr_tx_lock);
		return;
	}

	mutex_lock(&node->qrtr_tx_lock);
	atomic_set(&flow->pending, 0);
	wake_up_interruptible_all(&node->resume_tx);