Skip to contentSkip to conversation

Bluetooth: Fix missing rcu_read_unlock() in hci_bdaddr_is_paired()

PATCH In review Johan Hedberg 2 participants 2 messages Mar 11, 2015

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

PATCH 1/1 Bluetooth: Fix missing rcu_read_unlock() in hci_bdaddr_is_paired()

From: Johan Hedberg <[email protected]>

When finding a matching LTK the rcu_read_unlock() function was failing to release the RCU read lock. This patch adds the missing call to rcu_reaD_unlock().

---
 net/bluetooth/hci_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/bluetooth/hci_core.c +3 -1
index a35d8441187a..4eba9d6fc9a5 100644
@@ -2535,8 +2535,10 @@ bool hci_bdaddr_is_paired(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(k, &hdev->long_term_keys, list) {
-		if (k->bdaddr_type == addr_type && !bacmp(bdaddr, &k->bdaddr))
+		if (k->bdaddr_type == addr_type && !bacmp(bdaddr, &k->bdaddr)) {
+			rcu_read_unlock();
 			return true;
+		}
 	}
 	rcu_read_unlock();
 
Signature · 1 line
2.1.0
maintainer
#1 lore raw

Hi Johan,

Quoted 8 lines

When finding a matching LTK the rcu_read_unlock() function was failing to release the RCU read lock. This patch adds the missing call to rcu_reaD_unlock().

---
net/bluetooth/hci_core.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel