diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index f5049219219..67710d4927a 100755 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c @@ -50,8 +50,8 @@ #include #include -#include #include +#include #include "bnep.h" @@ -563,6 +563,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) u8 dst[ETH_ALEN], src[ETH_ALEN]; int err; + if (!l2cap_is_socket(sock)) + return -EBADFD; + BT_DBG(""); baswap((void *) dst, &bt_sk(sock->sk)->dst);