[NETLINK]: Fix infinite loops in synchronous netlink changes.
[sfrench/cifs-2.6.git] / net / decnet / netfilter / dn_rtmsg.c
index 101ddef9ba9aa2aad76b4c26cb88a98551c7dbc5..284a9998e53d756f02fe84a3cfd16ef2276cf617 100644 (file)
@@ -121,7 +121,7 @@ static void dnrmg_receive_user_sk(struct sock *sk, int len)
        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);
        }