Skip to content

Commit

Permalink
NFC: Use llcp_allocate_pdu to build the DISC frames
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed Oct 26, 2012
1 parent a6a0915 commit 9222390
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions net/nfc/llcp/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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;
Expand Down

0 comments on commit 9222390

Please sign in to comment.