Skip to content

Commit

Permalink
Phonet: hold socket before giving it to sk_deliver_skb()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Oct 15, 2009
1 parent b2d7644 commit 21912d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/phonet/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 21912d1

Please sign in to comment.