aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-08-26 23:57:58 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-09-16 13:35:55 -0400
commit808a049e2618bb535274aa41bf954232abc44bf5 (patch)
treeee53c93869c9594efa0fc40c1fe818ac9ddb8d78 /net/bluetooth/hci_core.c
parent9d4b68b23947e7bdf3f2707e76bd61572c523f6c (diff)
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. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 634debab4d54..0976eabdafb0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1344,8 +1344,10 @@ int hci_dev_reset(__u16 dev)
1344 1344
1345 hci_req_lock(hdev); 1345 hci_req_lock(hdev);
1346 1346
1347 if (!test_bit(HCI_UP, &hdev->flags)) 1347 if (!test_bit(HCI_UP, &hdev->flags)) {
1348 ret = -ENETDOWN;
1348 goto done; 1349 goto done;
1350 }
1349 1351
1350 /* Drop queues */ 1352 /* Drop queues */
1351 skb_queue_purge(&hdev->rx_q); 1353 skb_queue_purge(&hdev->rx_q);