diff options
author | Anton Altaparmakov <anton@tuxera.com> | 2012-02-27 09:01:22 +0000 |
---|---|---|
committer | Anton Altaparmakov <anton@tuxera.com> | 2012-02-27 09:01:22 +0000 |
commit | f621c5334396fd153cd882ea92466823b7e7b821 (patch) | |
tree | 7b829cad44dc0e5003d7cacac3a7a1b128637083 /net/bluetooth/af_bluetooth.c | |
parent | 0afa1b62e33250d4777c5803a98ae69fbe872061 (diff) | |
parent | 500dd2370e77c9551ba298bdeeb91b02d8402199 (diff) |
Merge branch 'master' of /Volumes/CaseSensitiveDisk/linux
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index ef92864ac625..72eb187a5f60 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -71,19 +71,16 @@ static const char *const bt_slock_key_strings[BT_MAX_PROTO] = { "slock-AF_BLUETOOTH-BTPROTO_AVDTP", }; -static inline void bt_sock_reclassify_lock(struct socket *sock, int proto) +void bt_sock_reclassify_lock(struct sock *sk, int proto) { - struct sock *sk = sock->sk; - - if (!sk) - return; - + BUG_ON(!sk); BUG_ON(sock_owned_by_user(sk)); sock_lock_init_class_and_name(sk, bt_slock_key_strings[proto], &bt_slock_key[proto], bt_key_strings[proto], &bt_lock_key[proto]); } +EXPORT_SYMBOL(bt_sock_reclassify_lock); int bt_sock_register(int proto, const struct net_proto_family *ops) { @@ -145,7 +142,8 @@ static int bt_sock_create(struct net *net, struct socket *sock, int proto, if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { err = bt_proto[proto]->create(net, sock, proto, kern); - bt_sock_reclassify_lock(sock, proto); + if (!err) + bt_sock_reclassify_lock(sock->sk, proto); module_put(bt_proto[proto]->owner); } |