Skip to contentSkip to conversation

Bluetooth: Add missing index added event on user channel failure

PATCH In review Marcel Holtmann 2 participants 2 messages Feb 17, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/2 Bluetooth: Add missing index added event on user channel failure

When the setup of user channel fails, the index added event is not sent and will cause issues with user interaction. This problem can be easily triggered with a LE only controller without a public address. In that case hci_dev_open() fails and that error case is not sending an event saying that the controller is available for normal use again.

---
 net/bluetooth/hci_sock.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_sock.c +1 -0
index 7552f9e3089c..68e51a84e72d 100644
@@ -716,6 +716,7 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr,
 		err = hci_dev_open(hdev->id);
 		if (err) {
 			clear_bit(HCI_USER_CHANNEL, &hdev->dev_flags);
+			mgmt_index_added(hdev);
 			hci_dev_put(hdev);
 			goto done;
 		}
Signature · 1 line
1.8.5.3
#1 lore raw

Hi Marcel,

Quoted 10 lines · Marcel Holtmann

When the setup of user channel fails, the index added event is not sent and will cause issues with user interaction. This problem can be easily triggered with a LE only controller without a public address. In that case hci_dev_open() fails and that error case is not sending an event saying that the controller is available for normal use again.

---
 net/bluetooth/hci_sock.c | 1 +
 1 file changed, 1 insertion(+)

Both patches have been applied to bluetooth-next. Thanks.

Johan