[PATCH -v2 10/12] Bluetooth: Move bt_accept_enqueue() call to l2cap_sock.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx>

bt_accept_enqueue() can be easily placed at the end of
There is no problem in moving to bt_accept_enqueue() to an earlier point
in the code, bt_accept_enqueue() only the sk to the it parents queue

Signed-off-by: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx>
 net/bluetooth/l2cap_core.c |    4 ----
 net/bluetooth/l2cap_sock.c |    2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index e53a8f9..d34d662 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1165,8 +1165,6 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
 	bacpy(&bt_sk(sk)->src, conn->src);
 	bacpy(&bt_sk(sk)->dst, conn->dst);
-	bt_accept_enqueue(parent, sk);
 	l2cap_chan_add(conn, chan);
@@ -3357,8 +3355,6 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
 	chan->psm  = psm;
 	chan->dcid = scid;
-	bt_accept_enqueue(parent, sk);
 	__l2cap_chan_add(conn, chan);
 	dcid = chan->scid;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index b19366c..27158f2 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -914,6 +914,8 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(void *data)
 	l2cap_sock_init(sk, parent);
+	bt_accept_enqueue(parent, sk);
 	return l2cap_pi(sk)->chan;

To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Bluez Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Bluez Devel]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]

Add to Google Powered by Linux