aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
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/bluetooth/l2cap_sock.c
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/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index a7278f05eafb..244287706f91 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -43,7 +43,7 @@ static struct bt_sock_list l2cap_sk_list = {
43static const struct proto_ops l2cap_sock_ops; 43static const struct proto_ops l2cap_sock_ops;
44static void l2cap_sock_init(struct sock *sk, struct sock *parent); 44static void l2cap_sock_init(struct sock *sk, struct sock *parent);
45static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, 45static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
46 int proto, gfp_t prio); 46 int proto, gfp_t prio, int kern);
47 47
48bool l2cap_is_socket(struct socket *sock) 48bool l2cap_is_socket(struct socket *sock)
49{ 49{
@@ -1193,7 +1193,7 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
1193 } 1193 }
1194 1194
1195 sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, 1195 sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP,
1196 GFP_ATOMIC); 1196 GFP_ATOMIC, 0);
1197 if (!sk) { 1197 if (!sk) {
1198 release_sock(parent); 1198 release_sock(parent);
1199 return NULL; 1199 return NULL;
@@ -1523,12 +1523,12 @@ static struct proto l2cap_proto = {
1523}; 1523};
1524 1524
1525static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, 1525static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
1526 int proto, gfp_t prio) 1526 int proto, gfp_t prio, int kern)
1527{ 1527{
1528 struct sock *sk; 1528 struct sock *sk;
1529 struct l2cap_chan *chan; 1529 struct l2cap_chan *chan;
1530 1530
1531 sk = sk_alloc(net, PF_BLUETOOTH, prio, &l2cap_proto); 1531 sk = sk_alloc(net, PF_BLUETOOTH, prio, &l2cap_proto, kern);
1532 if (!sk) 1532 if (!sk)
1533 return NULL; 1533 return NULL;
1534 1534
@@ -1574,7 +1574,7 @@ static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol,
1574 1574
1575 sock->ops = &l2cap_sock_ops; 1575 sock->ops = &l2cap_sock_ops;
1576 1576
1577 sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC); 1577 sk = l2cap_sock_alloc(net, sock, protocol, GFP_ATOMIC, kern);
1578 if (!sk) 1578 if (!sk)
1579 return -ENOMEM; 1579 return -ENOMEM;
1580 1580