Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / net / bluetooth / cmtp / core.c
index 5a6e634..f129e13 100644 (file)
@@ -336,6 +336,9 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
 
        BT_DBG("");
 
+       if (!l2cap_is_socket(sock))
+               return -EBADFD;
+
        session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);
        if (!session)
                return -ENOMEM;