[NETLINK]: Synchronous message processing.
[linux-3.10.git] / net / decnet / netfilter / dn_rtmsg.c
index f86a6259fd12171b1acc512713fff788089cb0f9..101ddef9ba9aa2aad76b4c26cb88a98551c7dbc5 100644 (file)
@@ -119,8 +119,9 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
 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((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
+       while (qlen-- && (skb = skb_dequeue(&sk->sk_receive_queue))) {
                dnrmg_receive_user_skb(skb);
                kfree_skb(skb);
        }