Skip to content

Commit

Permalink
NFC: Use skb_copy_datagram_iovec
Browse files Browse the repository at this point in the history
Safer and more robust than than memcpy_toiovec.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz committed Jan 11, 2013
1 parent fad2e37 commit fb97c3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/nfc/llcp/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
copied = min_t(unsigned int, rlen, len);

cskb = skb;
if (memcpy_toiovec(msg->msg_iov, cskb->data, copied)) {
if (skb_copy_datagram_iovec(cskb, 0, msg->msg_iov, copied)) {
if (!(flags & MSG_PEEK))
skb_queue_head(&sk->sk_receive_queue, skb);
return -EFAULT;
Expand Down

0 comments on commit fb97c3e

Please sign in to comment.