struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio);
-int l2cap_sock_release(struct socket *sock);
int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen);
int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags);
int l2cap_sock_listen(struct socket *sock, int backlog);
return err;
}
-int l2cap_sock_release(struct socket *sock)
-{
- struct sock *sk = sock->sk;
- int err;
-
- BT_DBG("sock %p, sk %p", sock, sk);
-
- if (!sk)
- return 0;
-
- err = l2cap_sock_shutdown(sock, 2);
-
- sock_orphan(sk);
- l2cap_sock_kill(sk);
- return err;
-}
-
static void l2cap_chan_ready(struct sock *sk)
{
struct sock *parent = bt_sk(sk)->parent;
sock_put(sk);
}
+static int l2cap_sock_release(struct socket *sock)
+{
+ struct sock *sk = sock->sk;
+ int err;
+
+ BT_DBG("sock %p, sk %p", sock, sk);
+
+ if (!sk)
+ return 0;
+
+ err = l2cap_sock_shutdown(sock, 2);
+
+ sock_orphan(sk);
+ l2cap_sock_kill(sk);
+ return err;
+}
+
static void l2cap_sock_destruct(struct sock *sk)
{
BT_DBG("sk %p", sk);