From 21912d1ca2546ca96743c91d5a4125aef2d9df70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 15 Oct 2009 12:29:14 -0700 Subject: [PATCH] Phonet: hold socket before giving it to sk_deliver_skb() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Denis-Courmont Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- net/phonet/socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/phonet/socket.c b/net/phonet/socket.c index 8c84190f22de..0412beb59a05 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c @@ -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); }