diff options
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index d942b946ba07..1220d8a41eb5 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -95,10 +95,13 @@ int bt_sock_unregister(int proto) | |||
95 | } | 95 | } |
96 | EXPORT_SYMBOL(bt_sock_unregister); | 96 | EXPORT_SYMBOL(bt_sock_unregister); |
97 | 97 | ||
98 | static int bt_sock_create(struct socket *sock, int proto) | 98 | static int bt_sock_create(struct net *net, struct socket *sock, int proto) |
99 | { | 99 | { |
100 | int err; | 100 | int err; |
101 | 101 | ||
102 | if (net != &init_net) | ||
103 | return -EAFNOSUPPORT; | ||
104 | |||
102 | if (proto < 0 || proto >= BT_MAX_PROTO) | 105 | if (proto < 0 || proto >= BT_MAX_PROTO) |
103 | return -EINVAL; | 106 | return -EINVAL; |
104 | 107 | ||
@@ -113,7 +116,7 @@ static int bt_sock_create(struct socket *sock, int proto) | |||
113 | read_lock(&bt_proto_lock); | 116 | read_lock(&bt_proto_lock); |
114 | 117 | ||
115 | if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { | 118 | if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { |
116 | err = bt_proto[proto]->create(sock, proto); | 119 | err = bt_proto[proto]->create(net, sock, proto); |
117 | module_put(bt_proto[proto]->owner); | 120 | module_put(bt_proto[proto]->owner); |
118 | } | 121 | } |
119 | 122 | ||