提交 92223906 编写于 作者: S Samuel Ortiz

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: NSamuel Ortiz <sameo@linux.intel.com>
上级 a6a0915f
...@@ -261,7 +261,6 @@ int nfc_llcp_disconnect(struct nfc_llcp_sock *sock) ...@@ -261,7 +261,6 @@ int nfc_llcp_disconnect(struct nfc_llcp_sock *sock)
struct sk_buff *skb; struct sk_buff *skb;
struct nfc_dev *dev; struct nfc_dev *dev;
struct nfc_llcp_local *local; struct nfc_llcp_local *local;
u16 size = 0;
pr_debug("Sending DISC\n"); pr_debug("Sending DISC\n");
...@@ -273,17 +272,10 @@ int nfc_llcp_disconnect(struct nfc_llcp_sock *sock) ...@@ -273,17 +272,10 @@ int nfc_llcp_disconnect(struct nfc_llcp_sock *sock)
if (dev == NULL) if (dev == NULL)
return -ENODEV; return -ENODEV;
size += LLCP_HEADER_SIZE; skb = llcp_allocate_pdu(sock, LLCP_PDU_DISC, 0);
size += dev->tx_headroom + dev->tx_tailroom + NFC_HEADER_SIZE;
skb = alloc_skb(size, GFP_ATOMIC);
if (skb == NULL) if (skb == NULL)
return -ENOMEM; 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); skb_queue_tail(&local->tx_queue, skb);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册