NFC: Keep socket alive until the DISC PDU is actually sent
[deliverable/linux.git] / net / nfc / llcp_core.c
index 158bdbf668ccf91fb211f49107d6b770d2fe98e4..1c4c048e0a1b622cec68c09332bc3f6354e910e8 100644 (file)
@@ -730,6 +730,13 @@ static void nfc_llcp_tx_work(struct work_struct *work)
                                       DUMP_PREFIX_OFFSET, 16, 1,
                                       skb->data, skb->len, true);
 
+                       if (ptype == LLCP_PDU_DISC && sk != NULL &&
+                           sk->sk_state == LLCP_DISCONNECTING) {
+                               nfc_llcp_sock_unlink(&local->sockets, sk);
+                               sock_orphan(sk);
+                               sock_put(sk);
+                       }
+
                        if (ptype == LLCP_PDU_I)
                                copy_skb = skb_copy(skb, GFP_ATOMIC);
 
This page took 0.032346 seconds and 5 git commands to generate.