aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-05-08 22:09:13 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-11 10:50:17 -0400
commit11aa9c28b4209242a9de0a661a7b3405adb568a0 (patch)
treed0dda021d89c17c54d54d227269f937d2d73b542 /net/decnet
parenteeb1bd5c40edb0e2fd925c8535e2fdebdbc5cef2 (diff)
net: Pass kern from net_proto_family.create to sk_alloc
In preparation for changing how struct net is refcounted on kernel sockets pass the knowledge that we are creating a kernel socket from sock_create_kern through to sk_alloc. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/af_decnet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 754484b3cd0e..675cf94e04f8 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -468,10 +468,10 @@ static struct proto dn_proto = {
468 .obj_size = sizeof(struct dn_sock), 468 .obj_size = sizeof(struct dn_sock),
469}; 469};
470 470
471static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gfp) 471static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gfp, int kern)
472{ 472{
473 struct dn_scp *scp; 473 struct dn_scp *scp;
474 struct sock *sk = sk_alloc(net, PF_DECnet, gfp, &dn_proto); 474 struct sock *sk = sk_alloc(net, PF_DECnet, gfp, &dn_proto, kern);
475 475
476 if (!sk) 476 if (!sk)
477 goto out; 477 goto out;
@@ -693,7 +693,7 @@ static int dn_create(struct net *net, struct socket *sock, int protocol,
693 } 693 }
694 694
695 695
696 if ((sk = dn_alloc_sock(net, sock, GFP_KERNEL)) == NULL) 696 if ((sk = dn_alloc_sock(net, sock, GFP_KERNEL, kern)) == NULL)
697 return -ENOBUFS; 697 return -ENOBUFS;
698 698
699 sk->sk_protocol = protocol; 699 sk->sk_protocol = protocol;
@@ -1096,7 +1096,7 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags)
1096 1096
1097 cb = DN_SKB_CB(skb); 1097 cb = DN_SKB_CB(skb);
1098 sk->sk_ack_backlog--; 1098 sk->sk_ack_backlog--;
1099 newsk = dn_alloc_sock(sock_net(sk), newsock, sk->sk_allocation); 1099 newsk = dn_alloc_sock(sock_net(sk), newsock, sk->sk_allocation, 0);
1100 if (newsk == NULL) { 1100 if (newsk == NULL) {
1101 release_sock(sk); 1101 release_sock(sk);
1102 kfree_skb(skb); 1102 kfree_skb(skb);