diff options
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 23bb968b314a..4b4e0201ebbe 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -838,6 +838,22 @@ static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct ms | |||
838 | return bt_sock_recvmsg(iocb, sock, msg, len, flags); | 838 | return bt_sock_recvmsg(iocb, sock, msg, len, flags); |
839 | } | 839 | } |
840 | 840 | ||
841 | /* Kill socket (only if zapped and orphan) | ||
842 | * Must be called on unlocked socket. | ||
843 | */ | ||
844 | void l2cap_sock_kill(struct sock *sk) | ||
845 | { | ||
846 | if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket) | ||
847 | return; | ||
848 | |||
849 | BT_DBG("sk %p state %d", sk, sk->sk_state); | ||
850 | |||
851 | /* Kill poor orphan */ | ||
852 | bt_sock_unlink(&l2cap_sk_list, sk); | ||
853 | sock_set_flag(sk, SOCK_DEAD); | ||
854 | sock_put(sk); | ||
855 | } | ||
856 | |||
841 | static int l2cap_sock_shutdown(struct socket *sock, int how) | 857 | static int l2cap_sock_shutdown(struct socket *sock, int how) |
842 | { | 858 | { |
843 | struct sock *sk = sock->sk; | 859 | struct sock *sk = sock->sk; |