Skip to contentSkip to conversation

Bluetooth: Remove unnecessary use of hci_dev_list_lock

PATCH In review [email protected] 2 participants 2 messages May 20, 2011 – May 30, 2011

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

PATCH 1/1 Bluetooth: Remove unnecessary use of hci_dev_list_lock

From: Johan Hedberg <[email protected]>

The get_connections function has no need to use hci_dev_list_lock. The code was there probably because of a copy-paste mistake.

---
 net/bluetooth/mgmt.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
net/bluetooth/mgmt.c +0 -4
index dae382c..fe835b8 100644
@@ -1092,8 +1092,6 @@ static int get_connections(struct sock *sk, u16 index)
 
 	put_unaligned_le16(count, &rp->conn_count);
 
-	read_lock(&hci_dev_list_lock);
-
 	i = 0;
 	list_for_each(p, &hdev->conn_hash.list) {
 		struct hci_conn *c = list_entry(p, struct hci_conn, list);
@@ -1101,8 +1099,6 @@ static int get_connections(struct sock *sk, u16 index)
 		bacpy(&rp->conn[i++], &c->dst);
 	}
 
-	read_unlock(&hci_dev_list_lock);
-
 	err = cmd_complete(sk, index, MGMT_OP_GET_CONNECTIONS, rp, rp_len);
 
 unlock:
Signature · 1 line
1.7.5.1
#1 lore raw

Hi Johan,

Quoted 9 lines · * [email protected] <[email protected]> [2011-05-20 11:50:41 -0700]:

From: Johan Hedberg <[email protected]>

The get_connections function has no need to use hci_dev_list_lock. The code was there probably because of a copy-paste mistake.

---
 net/bluetooth/mgmt.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

Patch has been applied, thanks.

Signature · 2 lines
Gustavo F. Padovan
http://profusion.mobi