aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-12-07 09:55:19 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-01-09 18:44:31 -0500
commit2593c2c6ec236c6aedbb8182d103185ab6580285 (patch)
treec5377cf7da2044aa51bbe8c09dc9e8b6df292c95 /net
parentcb950d9304b2965bef07e26d6c0eb34a0b1f75fe (diff)
NFC: llcp: Remove the tx backlog queue
Not only it was improperly use to queue backlogged RX skbuffs, but it was also not processed at all. If the socket receive queue is full we simply drop the incoming packets. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/nfc/llcp/llcp.c5
-rw-r--r--net/nfc/llcp/llcp.h1
-rw-r--r--net/nfc/llcp/sock.c2
3 files changed, 2 insertions, 6 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index 6c5971437826..003c82fe8bd7 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -54,7 +54,6 @@ static void nfc_llcp_socket_purge(struct nfc_llcp_sock *sock)
54 54
55 skb_queue_purge(&sock->tx_queue); 55 skb_queue_purge(&sock->tx_queue);
56 skb_queue_purge(&sock->tx_pending_queue); 56 skb_queue_purge(&sock->tx_pending_queue);
57 skb_queue_purge(&sock->tx_backlog_queue);
58 57
59 if (local == NULL) 58 if (local == NULL)
60 return; 59 return;
@@ -785,7 +784,7 @@ static void nfc_llcp_recv_ui(struct nfc_llcp_local *local,
785 skb_pull(skb, LLCP_HEADER_SIZE); 784 skb_pull(skb, LLCP_HEADER_SIZE);
786 if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) { 785 if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) {
787 pr_err("receive queue is full\n"); 786 pr_err("receive queue is full\n");
788 skb_queue_head(&llcp_sock->tx_backlog_queue, skb); 787 kfree_skb(skb);
789 } 788 }
790 789
791 nfc_llcp_sock_put(llcp_sock); 790 nfc_llcp_sock_put(llcp_sock);
@@ -980,7 +979,7 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local,
980 skb_pull(skb, LLCP_HEADER_SIZE + LLCP_SEQUENCE_SIZE); 979 skb_pull(skb, LLCP_HEADER_SIZE + LLCP_SEQUENCE_SIZE);
981 if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) { 980 if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) {
982 pr_err("receive queue is full\n"); 981 pr_err("receive queue is full\n");
983 skb_queue_head(&llcp_sock->tx_backlog_queue, skb); 982 kfree_skb(skb);
984 } 983 }
985 } 984 }
986 985
diff --git a/net/nfc/llcp/llcp.h b/net/nfc/llcp/llcp.h
index 0d62366f8cc3..0eae5c509504 100644
--- a/net/nfc/llcp/llcp.h
+++ b/net/nfc/llcp/llcp.h
@@ -121,7 +121,6 @@ struct nfc_llcp_sock {
121 121
122 struct sk_buff_head tx_queue; 122 struct sk_buff_head tx_queue;
123 struct sk_buff_head tx_pending_queue; 123 struct sk_buff_head tx_pending_queue;
124 struct sk_buff_head tx_backlog_queue;
125 124
126 struct list_head accept_queue; 125 struct list_head accept_queue;
127 struct sock *parent; 126 struct sock *parent;
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c
index ba1900700958..12ec4879b4ba 100644
--- a/net/nfc/llcp/sock.c
+++ b/net/nfc/llcp/sock.c
@@ -808,7 +808,6 @@ struct sock *nfc_llcp_sock_alloc(struct socket *sock, int type, gfp_t gfp)
808 llcp_sock->reserved_ssap = LLCP_SAP_MAX; 808 llcp_sock->reserved_ssap = LLCP_SAP_MAX;
809 skb_queue_head_init(&llcp_sock->tx_queue); 809 skb_queue_head_init(&llcp_sock->tx_queue);
810 skb_queue_head_init(&llcp_sock->tx_pending_queue); 810 skb_queue_head_init(&llcp_sock->tx_pending_queue);
811 skb_queue_head_init(&llcp_sock->tx_backlog_queue);
812 INIT_LIST_HEAD(&llcp_sock->accept_queue); 811 INIT_LIST_HEAD(&llcp_sock->accept_queue);
813 812
814 if (sock != NULL) 813 if (sock != NULL)
@@ -823,7 +822,6 @@ void nfc_llcp_sock_free(struct nfc_llcp_sock *sock)
823 822
824 skb_queue_purge(&sock->tx_queue); 823 skb_queue_purge(&sock->tx_queue);
825 skb_queue_purge(&sock->tx_pending_queue); 824 skb_queue_purge(&sock->tx_pending_queue);
826 skb_queue_purge(&sock->tx_backlog_queue);
827 825
828 list_del_init(&sock->accept_queue); 826 list_del_init(&sock->accept_queue);
829 827