From 766e9037cc139ee25ed93ee5ad11e1450c4b99f6 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Wed, 14 Oct 2009 20:40:11 -0700 Subject: net: sk_drops consolidation sock_queue_rcv_skb() can update sk_drops itself, removing need for callers to take care of it. This is more consistent since sock_queue_rcv_skb() also reads sk_drops when queueing a skb. This adds sk_drops managment to many protocols that not cared yet. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- net/phonet/datagram.c | 6 ++---- net/phonet/pep.c | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'net/phonet') diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index ef5c75c372e4..67f072e94d00 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c @@ -159,11 +159,9 @@ out_nofree: static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb) { int err = sock_queue_rcv_skb(sk, skb); - if (err < 0) { + + if (err < 0) kfree_skb(skb); - if (err == -ENOMEM) - atomic_inc(&sk->sk_drops); - } return err ? NET_RX_DROP : NET_RX_SUCCESS; } diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 5f32d217535b..cbaa1d67d77b 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c @@ -360,8 +360,6 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb) err = sock_queue_rcv_skb(sk, skb); if (!err) return 0; - if (err == -ENOMEM) - atomic_inc(&sk->sk_drops); break; } -- cgit v1.2.3-58-ga151