Skip to contentSkip to conversation

bluetooth:Fix locking issues in the function l2cap_connect_cfm

PATCH Johan Hedberg 1 participant 1 message Aug 24, 2015 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Nicholas,

Quoted 11 lines · Nicholas Krause
net/bluetooth/l2cap_core.c +1 -0
@@ -7285,6 +7285,7 @@ static void l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
 		struct l2cap_chan *chan, *next;
 
 		/* Client fixed channels should override server ones */
+		mutex_lock(&conn->chan_lock);
 		if (__l2cap_get_chan_by_dcid(conn, pchan->scid))
 			goto next;
 

net/bluetooth/l2cap_core.c static void l2cap_connect_cfm(struct hci_conn *hcon, u8 status) · line 7305

Quoted 4 lines
net/bluetooth/l2cap_core.c +1 -0
@@ -7301,6 +7302,7 @@ static void l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
 
 		l2cap_chan_unlock(pchan);
 next:
+		mutex_lock(&conn->chan_lock);

Shouldn't this be unlock? Btw, It'd be easier to trac the revisions of your patches if you versioned them properly, e.g. in this case with "[PATCH v2} Bluetooth: ...".

Johan