Skip to content

Commit

Permalink
Bluetooth: Report error for HCI reset ioctl when device is down
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcel Holtmann authored and Gustavo Padovan committed Sep 16, 2013
1 parent 9d4b68b commit 808a049
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,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);
Expand Down

0 comments on commit 808a049

Please sign in to comment.