aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/rawsock.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-12-14 10:43:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-14 14:50:12 -0500
commit7c7cd3bfec68fee33b30d177df6a6a0c4bbdc59d (patch)
tree7b7332d63303d30c73b4ecd8a300e84d801baa33 /net/nfc/rawsock.c
parent52858b51b2c779a8f9db32accf774b165522ad81 (diff)
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>
Diffstat (limited to 'net/nfc/rawsock.c')
-rw-r--r--net/nfc/rawsock.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index 5e9b991eac13..11ac0a17156e 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -208,13 +208,10 @@ static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock,
208 if (sock->state != SS_CONNECTED) 208 if (sock->state != SS_CONNECTED)
209 return -ENOTCONN; 209 return -ENOTCONN;
210 210
211 skb = sock_alloc_send_skb(sk, len + dev->tx_headroom + dev->tx_tailroom + NFC_HEADER_SIZE, 211 skb = nfc_alloc_send_skb(dev, sk, msg->msg_flags, len, &rc);
212 msg->msg_flags & MSG_DONTWAIT, &rc); 212 if (skb == NULL)
213 if (!skb)
214 return rc; 213 return rc;
215 214
216 skb_reserve(skb, dev->tx_headroom + NFC_HEADER_SIZE);
217
218 rc = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); 215 rc = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
219 if (rc < 0) { 216 if (rc < 0) {
220 kfree_skb(skb); 217 kfree_skb(skb);