diff options
Diffstat (limited to 'net/nfc/llcp/sock.c')
-rw-r--r-- | net/nfc/llcp/sock.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index fea22eb41b82..5332751943a9 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c | |||
@@ -672,25 +672,27 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
672 | copied = min_t(unsigned int, rlen, len); | 672 | copied = min_t(unsigned int, rlen, len); |
673 | 673 | ||
674 | cskb = skb; | 674 | cskb = skb; |
675 | if (memcpy_toiovec(msg->msg_iov, cskb->data, copied)) { | 675 | if (skb_copy_datagram_iovec(cskb, 0, msg->msg_iov, copied)) { |
676 | if (!(flags & MSG_PEEK)) | 676 | if (!(flags & MSG_PEEK)) |
677 | skb_queue_head(&sk->sk_receive_queue, skb); | 677 | skb_queue_head(&sk->sk_receive_queue, skb); |
678 | return -EFAULT; | 678 | return -EFAULT; |
679 | } | 679 | } |
680 | 680 | ||
681 | sock_recv_timestamp(msg, sk, skb); | ||
682 | |||
681 | if (sk->sk_type == SOCK_DGRAM && msg->msg_name) { | 683 | if (sk->sk_type == SOCK_DGRAM && msg->msg_name) { |
682 | struct nfc_llcp_ui_cb *ui_cb = nfc_llcp_ui_skb_cb(skb); | 684 | struct nfc_llcp_ui_cb *ui_cb = nfc_llcp_ui_skb_cb(skb); |
683 | struct sockaddr_nfc_llcp sockaddr; | 685 | struct sockaddr_nfc_llcp *sockaddr = |
686 | (struct sockaddr_nfc_llcp *) msg->msg_name; | ||
684 | 687 | ||
685 | pr_debug("Datagram socket %d %d\n", ui_cb->dsap, ui_cb->ssap); | 688 | msg->msg_namelen = sizeof(struct sockaddr_nfc_llcp); |
686 | 689 | ||
687 | sockaddr.sa_family = AF_NFC; | 690 | pr_debug("Datagram socket %d %d\n", ui_cb->dsap, ui_cb->ssap); |
688 | sockaddr.nfc_protocol = NFC_PROTO_NFC_DEP; | ||
689 | sockaddr.dsap = ui_cb->dsap; | ||
690 | sockaddr.ssap = ui_cb->ssap; | ||
691 | 691 | ||
692 | memcpy(msg->msg_name, &sockaddr, sizeof(sockaddr)); | 692 | sockaddr->sa_family = AF_NFC; |
693 | msg->msg_namelen = sizeof(sockaddr); | 693 | sockaddr->nfc_protocol = NFC_PROTO_NFC_DEP; |
694 | sockaddr->dsap = ui_cb->dsap; | ||
695 | sockaddr->ssap = ui_cb->ssap; | ||
694 | } | 696 | } |
695 | 697 | ||
696 | /* Mark read part of skb as used */ | 698 | /* Mark read part of skb as used */ |
@@ -806,7 +808,6 @@ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp) | |||
806 | llcp_sock->reserved_ssap = LLCP_SAP_MAX; | 808 | llcp_sock->reserved_ssap = LLCP_SAP_MAX; |
807 | skb_queue_head_init(&llcp_sock->tx_queue); | 809 | skb_queue_head_init(&llcp_sock->tx_queue); |
808 | skb_queue_head_init(&llcp_sock->tx_pending_queue); | 810 | skb_queue_head_init(&llcp_sock->tx_pending_queue); |
809 | skb_queue_head_init(&llcp_sock->tx_backlog_queue); | ||
810 | INIT_LIST_HEAD(&llcp_sock->accept_queue); | 811 | INIT_LIST_HEAD(&llcp_sock->accept_queue); |
811 | 812 | ||
812 | if (sock != NULL) | 813 | if (sock != NULL) |
@@ -821,7 +822,6 @@ void nfc_llcp_sock_free(struct nfc_llcp_sock *sock) | |||
821 | 822 | ||
822 | skb_queue_purge(&sock->tx_queue); | 823 | skb_queue_purge(&sock->tx_queue); |
823 | skb_queue_purge(&sock->tx_pending_queue); | 824 | skb_queue_purge(&sock->tx_pending_queue); |
824 | skb_queue_purge(&sock->tx_backlog_queue); | ||
825 | 825 | ||
826 | list_del_init(&sock->accept_queue); | 826 | list_del_init(&sock->accept_queue); |
827 | 827 | ||