The qlen should continue to decrement, even if we
pop partially processed SKBs back onto the receive queue.
Signed-off-by: David S. Miller <davem@davemloft.net>
if (qlen > skb_queue_len(&sk->sk_receive_queue))
qlen = skb_queue_len(&sk->sk_receive_queue);
- while (qlen--) {
+ for (; qlen; qlen--) {
skb = skb_dequeue(&sk->sk_receive_queue);
if (rtnetlink_rcv_skb(skb)) {
- if (skb->len) {
+ if (skb->len)
skb_queue_head(&sk->sk_receive_queue,
skb);
- qlen++;
- } else
+ else
kfree_skb(skb);
break;
}
struct sk_buff *skb;
unsigned int qlen = skb_queue_len(&sk->sk_receive_queue);
- while (qlen-- && (skb = skb_dequeue(&sk->sk_receive_queue))) {
+ for (; qlen && (skb = skb_dequeue(&sk->sk_receive_queue)); qlen--) {
dnrmg_receive_user_skb(skb);
kfree_skb(skb);
}
if (qlen > skb_queue_len(&sk->sk_receive_queue))
qlen = skb_queue_len(&sk->sk_receive_queue);
- while (qlen--) {
+ for (; qlen; qlen--) {
skb = skb_dequeue(&sk->sk_receive_queue);
if (xfrm_user_rcv_skb(skb)) {
- if (skb->len) {
+ if (skb->len)
skb_queue_head(&sk->sk_receive_queue,
skb);
- qlen++;
- } else
+ else
kfree_skb(skb);
break;
}