NFC: Add tx skb allocation routine
This is a factorization of the current rawsock tx skb allocation routine, as it will be used by the LLCP code. We also rename nfc_alloc_skb to nfc_alloc_recv_skb for consistency sake. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
52858b51b2
commit
7c7cd3bfec
@@ -208,13 +208,10 @@ static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock,
|
||||
if (sock->state != SS_CONNECTED)
|
||||
return -ENOTCONN;
|
||||
|
||||
skb = sock_alloc_send_skb(sk, len + dev->tx_headroom + dev->tx_tailroom + NFC_HEADER_SIZE,
|
||||
msg->msg_flags & MSG_DONTWAIT, &rc);
|
||||
if (!skb)
|
||||
skb = nfc_alloc_send_skb(dev, sk, msg->msg_flags, len, &rc);
|
||||
if (skb == NULL)
|
||||
return rc;
|
||||
|
||||
skb_reserve(skb, dev->tx_headroom + NFC_HEADER_SIZE);
|
||||
|
||||
rc = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
|
||||
if (rc < 0) {
|
||||
kfree_skb(skb);
|
||||
|
Reference in New Issue
Block a user