Skip to content

Commit

Permalink
nfc: llcp: Revert "NFC: Keep socket alive until the DISC PDU is actua…
Browse files Browse the repository at this point in the history
…lly sent"

This reverts commit 17f7ae1.

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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
krzk authored and davem330 committed Mar 3, 2022
1 parent a06b804 commit 44cd576
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion net/nfc/llcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions net/nfc/llcp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 0 additions & 7 deletions net/nfc/llcp_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44cd576

Please sign in to comment.