mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
net: qrtr: avoid calling node lookup from rx worker
Acquiring node in rx worker thread results in deadlock when node release function is called from rx thread which in turn will wait for rx thread to finish. No need to acquire node in rx worker thread as node is guaranteed to be present till the rx thread finishes. CRs-Fixed: 2579396 Change-Id: I34903b672961e879596b58e28be5e333db5e10d8 Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
This commit is contained in:
parent
b4277022c8
commit
c59f36db81
1 changed files with 2 additions and 5 deletions
|
|
@ -881,13 +881,11 @@ static bool qrtr_must_forward(struct qrtr_node *src,
|
|||
return false;
|
||||
}
|
||||
|
||||
static void qrtr_fwd_ctrl_pkt(struct sk_buff *skb)
|
||||
static void qrtr_fwd_ctrl_pkt(struct qrtr_node *src, struct sk_buff *skb)
|
||||
{
|
||||
struct qrtr_node *node;
|
||||
struct qrtr_node *src;
|
||||
struct qrtr_cb *cb = (struct qrtr_cb *)skb->cb;
|
||||
|
||||
src = qrtr_node_lookup(cb->src_node);
|
||||
down_read(&qrtr_epts_lock);
|
||||
list_for_each_entry(node, &qrtr_all_epts, item) {
|
||||
struct sockaddr_qrtr from;
|
||||
|
|
@ -912,7 +910,6 @@ static void qrtr_fwd_ctrl_pkt(struct sk_buff *skb)
|
|||
qrtr_node_enqueue(node, skbn, cb->type, &from, &to, 0);
|
||||
}
|
||||
up_read(&qrtr_epts_lock);
|
||||
qrtr_node_release(src);
|
||||
}
|
||||
|
||||
static void qrtr_fwd_pkt(struct sk_buff *skb, struct qrtr_cb *cb)
|
||||
|
|
@ -972,7 +969,7 @@ static void qrtr_node_rx_work(struct kthread_work *work)
|
|||
struct qrtr_sock *ipc;
|
||||
|
||||
if (cb->type != QRTR_TYPE_DATA)
|
||||
qrtr_fwd_ctrl_pkt(skb);
|
||||
qrtr_fwd_ctrl_pkt(node, skb);
|
||||
|
||||
if (cb->type == QRTR_TYPE_RESUME_TX) {
|
||||
if (cb->dst_node != qrtr_local_nid) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue