Skip to contentSkip to conversation

Bluetooth: Remove unnecessary l2cap_chan_unlock before l2cap_chan_add

PATCH New [email protected] 1 participant 1 message Aug 15, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Remove unnecessary l2cap_chan_unlock before l2cap_chan_add

From: Johan Hedberg <[email protected]>

The l2cap_chan_add() function doesn't require the channel to be unlocked. It only requires the l2cap_conn to be unlocked. Therefore, it's unnecessary to unlock a channel before calling l2cap_chan_add(). This patch removes such unnecessary unlocking from the l2cap_chan_connect() function.

---
 net/bluetooth/l2cap_core.c | 2 --
 1 file changed, 2 deletions(-)
net/bluetooth/l2cap_core.c +0 -2
index 52b56808d5d3..777c41dbfdbe 100644
@@ -7078,9 +7078,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
 	bacpy(&chan->src, &hcon->src);
 	chan->src_type = bdaddr_type(hcon, hcon->src_type);
 
-	l2cap_chan_unlock(chan);
 	l2cap_chan_add(conn, chan);
-	l2cap_chan_lock(chan);
 
 	/* l2cap_chan_add takes its own ref so we can drop this one */
 	hci_conn_drop(hcon);
Signature · 1 line
1.9.3