Skip to contentSkip to conversation

Bluetooth: Report error for HCI reset ioctl when device is down

PATCH In review Marcel Holtmann 2 participants 2 messages Aug 27, 2013 – Sep 1, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Report error for HCI reset ioctl when device is down

Even if this is legacy API, there is no reason to not report a proper error when trying to reset a HCI device that is down.

---
 net/bluetooth/hci_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/bluetooth/hci_core.c +3 -1
index 8d9b87d..c529e85 100644
@@ -1341,8 +1341,10 @@ int hci_dev_reset(__u16 dev)
 
 	hci_req_lock(hdev);
 
-	if (!test_bit(HCI_UP, &hdev->flags))
+	if (!test_bit(HCI_UP, &hdev->flags)) {
+		ret = -ENETDOWN;
 		goto done;
+	}
 
 	/* Drop queues */
 	skb_queue_purge(&hdev->rx_q);
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Marcel,

2013-08-26 Marcel Holtmann <[email protected]>:

Quoted 7 lines

Even if this is legacy API, there is no reason to not report a proper error when trying to reset a HCI device that is down.

---
 net/bluetooth/hci_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch has been applied to bluetooth-next. Thanks.

Gustavo