aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/bluetooth/l2cap.h1
-rw-r--r--net/bluetooth/l2cap_core.c17
-rw-r--r--net/bluetooth/l2cap_sock.c17
3 files changed, 17 insertions, 18 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 533bef5f6341..d0baf4163261 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -438,7 +438,6 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent);
438struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, 438struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
439 int proto, gfp_t prio); 439 int proto, gfp_t prio);
440 440
441int l2cap_sock_release(struct socket *sock);
442int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen); 441int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen);
443int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags); 442int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags);
444int l2cap_sock_listen(struct socket *sock, int backlog); 443int l2cap_sock_listen(struct socket *sock, int backlog);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 74a3ea3625d6..5765a82cf380 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2159,23 +2159,6 @@ int l2cap_sock_shutdown(struct socket *sock, int how)
2159 return err; 2159 return err;
2160} 2160}
2161 2161
2162int l2cap_sock_release(struct socket *sock)
2163{
2164 struct sock *sk = sock->sk;
2165 int err;
2166
2167 BT_DBG("sock %p, sk %p", sock, sk);
2168
2169 if (!sk)
2170 return 0;
2171
2172 err = l2cap_sock_shutdown(sock, 2);
2173
2174 sock_orphan(sk);
2175 l2cap_sock_kill(sk);
2176 return err;
2177}
2178
2179static void l2cap_chan_ready(struct sock *sk) 2162static void l2cap_chan_ready(struct sock *sk)
2180{ 2163{
2181 struct sock *parent = bt_sk(sk)->parent; 2164 struct sock *parent = bt_sk(sk)->parent;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index c1455f72bf03..20efd240a786 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -62,6 +62,23 @@ static void l2cap_sock_timeout(unsigned long arg)
62 sock_put(sk); 62 sock_put(sk);
63} 63}
64 64
65static int l2cap_sock_release(struct socket *sock)
66{
67 struct sock *sk = sock->sk;
68 int err;
69
70 BT_DBG("sock %p, sk %p", sock, sk);
71
72 if (!sk)
73 return 0;
74
75 err = l2cap_sock_shutdown(sock, 2);
76
77 sock_orphan(sk);
78 l2cap_sock_kill(sk);
79 return err;
80}
81
65static void l2cap_sock_destruct(struct sock *sk) 82static void l2cap_sock_destruct(struct sock *sk)
66{ 83{
67 BT_DBG("sk %p", sk); 84 BT_DBG("sk %p", sk);