Bluetooth: Move check for backlog size to l2cap_sock.c
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 28 May 2012 01:27:55 +0000 (22:27 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 5 Jun 2012 03:34:11 +0000 (06:34 +0300)
Remove socket specific code from l2cap_core.c

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c

index 35e6d7dd329b475d0f3fffea481e132ff69b7f05..d64c836f2bcf3e691c72935e5e6b314451ddd125 100644 (file)
@@ -1156,12 +1156,6 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
 
        lock_sock(parent);
 
-       /* Check for backlog size */
-       if (sk_acceptq_is_full(parent)) {
-               BT_DBG("backlog full %d", parent->sk_ack_backlog);
-               goto clean;
-       }
-
        chan = pchan->ops->new_connection(pchan);
        if (!chan)
                goto clean;
@@ -3349,12 +3343,6 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
 
        result = L2CAP_CR_NO_MEM;
 
-       /* Check for backlog size */
-       if (sk_acceptq_is_full(parent)) {
-               BT_DBG("backlog full %d", parent->sk_ack_backlog);
-               goto response;
-       }
-
        chan = pchan->ops->new_connection(pchan);
        if (!chan)
                goto response;
index 5563023001c65310decf1690ddb62ea16df542cf..d856cc8f22a3fd3bdd82d9afd3778662573945f7 100644 (file)
@@ -895,6 +895,12 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
 {
        struct sock *sk, *parent = chan->data;
 
+       /* Check for backlog size */
+       if (sk_acceptq_is_full(parent)) {
+               BT_DBG("backlog full %d", parent->sk_ack_backlog);
+               return NULL;
+       }
+
        sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP,
                                                                GFP_ATOMIC);
        if (!sk)