diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index f50492192197..77cdd94fd607 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c @@ -50,6 +50,7 @@ #include #include +#include #include #include @@ -565,6 +566,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) BT_DBG(""); + if (!l2cap_is_socket(sock)) + return -EBADFD; + baswap((void *) dst, &bt_sk(sock->sk)->dst); baswap((void *) src, &bt_sk(sock->sk)->src);