Phonet: hold socket before giving it to sk_deliver_skb()

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Rémi Denis-Courmont 2009-10-15 12:29:14 -07:00 committed by David S. Miller
parent b2d76447df
commit 21912d1ca2

View file

@ -112,8 +112,10 @@ void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb)
continue;
clone = skb_clone(skb, GFP_ATOMIC);
if (clone)
if (clone) {
sock_hold(sknode);
sk_receive_skb(sknode, clone, 0);
}
}
spin_unlock(&pnsocks.lock);
}