From c20b68a221ca1a4d52ce843e31b0873c8e1971f5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 2 Nov 2015 11:17:11 +0200 Subject: [PATCH] Bluetooth: Remove broken check for existing rx CID This check was trying to optimize the CID allocation, but it adds little value and was actually broken because of the wrong CID passed to the lookup function. Change-Id: I793be0c5eeccb931cea4a5430991d4e692926da6 Signed-off-by: Johan Hedberg --- net/bluetooth/l2cap.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index eed4be0c90d..0dcbad2d8a7 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -120,12 +120,6 @@ static void l2cap_chan_alloc_cid(struct bt_conn *conn, return; } - /* Try matching dcid first */ - if (!bt_l2cap_lookup_rx_cid(conn, chan->rx.cid)) { - chan->rx.cid = chan->tx.cid; - return; - } - /* TODO: Check conn type before assigning cid */ for (cid = L2CAP_LE_DYN_CID_START; cid <= L2CAP_LE_DYN_CID_END; cid++) { if (!bt_l2cap_lookup_rx_cid(conn, cid)) {