Commit 0f4821e7 authored by David S. Miller's avatar David S. Miller Committed by David S. Miller
Browse files

[XFRM/RTNETLINK]: Decrement qlen properly in {xfrm_,rt}netlink_rcv().



If we free up a partially processed packet because it's
skb->len dropped to zero, we need to decrement qlen because
we are dropping out of the top-level loop so it will do
the decrement for us.

Spotted by Herbert Xu.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09e14305
...@@ -632,8 +632,10 @@ static void rtnetlink_rcv(struct sock *sk, int len) ...@@ -632,8 +632,10 @@ static void rtnetlink_rcv(struct sock *sk, int len)
if (skb->len) if (skb->len)
skb_queue_head(&sk->sk_receive_queue, skb_queue_head(&sk->sk_receive_queue,
skb); skb);
else else {
kfree_skb(skb); kfree_skb(skb);
qlen--;
}
break; break;
} }
kfree_skb(skb); kfree_skb(skb);
......
...@@ -1024,8 +1024,10 @@ static void xfrm_netlink_rcv(struct sock *sk, int len) ...@@ -1024,8 +1024,10 @@ static void xfrm_netlink_rcv(struct sock *sk, int len)
if (skb->len) if (skb->len)
skb_queue_head(&sk->sk_receive_queue, skb_queue_head(&sk->sk_receive_queue,
skb); skb);
else else {
kfree_skb(skb); kfree_skb(skb);
qlen--;
}
break; break;
} }
kfree_skb(skb); kfree_skb(skb);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment