diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-05 01:09:07 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-26 18:26:47 +0200 |
commit | 922239064bb39b4ed9329ffd9418c20f8d64cbbb (patch) | |
tree | e521a1b758bbdb369be2a9da85f6d0046da78901 /net/nfc | |
parent | NFC: Avoid falling back to SYMM when sk is NULL (diff) | |
download | linux-922239064bb39b4ed9329ffd9418c20f8d64cbbb.tar.xz linux-922239064bb39b4ed9329ffd9418c20f8d64cbbb.zip |
NFC: Use llcp_allocate_pdu to build the DISC frames
We no longer need to be atomic as this is only called from
llcp_sock_release().
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/llcp/commands.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c index c45ccd6c094c..5e33cba43936 100644 --- a/net/nfc/llcp/commands.c +++ b/net/nfc/llcp/commands.c @@ -261,7 +261,6 @@ int nfc_llcp_disconnect(struct nfc_llcp_sock *sock) struct sk_buff *skb; struct nfc_dev *dev; struct nfc_llcp_local *local; - u16 size = 0; pr_debug("Sending DISC\n"); @@ -273,17 +272,10 @@ int nfc_llcp_disconnect(struct nfc_llcp_sock *sock) if (dev == NULL) return -ENODEV; - size += LLCP_HEADER_SIZE; - size += dev->tx_headroom + dev->tx_tailroom + NFC_HEADER_SIZE; - - skb = alloc_skb(size, GFP_ATOMIC); + skb = llcp_allocate_pdu(sock, LLCP_PDU_DISC, 0); if (skb == NULL) return -ENOMEM; - skb_reserve(skb, dev->tx_headroom + NFC_HEADER_SIZE); - - skb = llcp_add_header(skb, sock->dsap, sock->ssap, LLCP_PDU_DISC); - skb_queue_tail(&local->tx_queue, skb); return 0; |