nfc: llcp: Revert "NFC: Keep socket alive until the DISC PDU is actually sent"
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Wed, 2 Mar 2022 19:25:23 +0000 (20:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Mar 2022 10:43:37 +0000 (10:43 +0000)
This reverts commit 17f7ae16aef1f58bc4af4c7a16b8778a91a30255.

The commit brought a new socket state LLCP_DISCONNECTING, which was
never set, only read, so socket could never set to such state.

Remove the dead code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/llcp.h
net/nfc/llcp_core.c
net/nfc/llcp_sock.c

index d49d4bf2e37c8c97df672fa37a496983d66e6e52..c1d9be636933c02d2aa8687c357a19c41836d53a 100644 (file)
@@ -6,7 +6,6 @@
 enum llcp_state {
        LLCP_CONNECTED = 1, /* wait_for_packet() wants that */
        LLCP_CONNECTING,
-       LLCP_DISCONNECTING,
        LLCP_CLOSED,
        LLCP_BOUND,
        LLCP_LISTEN,
index b70d5042bf744c297403b58e19c25fef75165d10..3364caabef8b1908e264f8462553eef93c825d64 100644 (file)
@@ -737,13 +737,6 @@ static void nfc_llcp_tx_work(struct work_struct *work)
                        print_hex_dump_debug("LLCP Tx: ", 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);
 
index 5c5705f5028b62eea5a3e61f2839eaafdab36a44..4ca35791c93b734f0b1bc32a82bfca1c9b3740ed 100644 (file)
@@ -641,13 +641,6 @@ static int llcp_sock_release(struct socket *sock)
 
        release_sock(sk);
 
-       /* Keep this sock alive and therefore do not remove it from the sockets
-        * list until the DISC PDU has been actually sent. Otherwise we would
-        * reply with DM PDUs before sending the DISC one.
-        */
-       if (sk->sk_state == LLCP_DISCONNECTING)
-               return err;
-
 out:
        sock_orphan(sk);
        sock_put(sk);