summaryrefslogtreecommitdiffstats
path: root/kernel/net/phonet/af_phonet.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/phonet/af_phonet.c')
-rw-r--r--kernel/net/phonet/af_phonet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/net/phonet/af_phonet.c b/kernel/net/phonet/af_phonet.c
index 32ab87d34..f92575366 100644
--- a/kernel/net/phonet/af_phonet.c
+++ b/kernel/net/phonet/af_phonet.c
@@ -97,7 +97,7 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
goto out;
}
- sk = sk_alloc(net, PF_PHONET, GFP_KERNEL, pnp->prot);
+ sk = sk_alloc(net, PF_PHONET, GFP_KERNEL, pnp->prot, kern);
if (sk == NULL) {
err = -ENOMEM;
goto out;
@@ -377,6 +377,10 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
struct sockaddr_pn sa;
u16 len;
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ return NET_RX_DROP;
+
/* check we have at least a full Phonet header */
if (!pskb_pull(skb, sizeof(struct phonethdr)))
goto out;