Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 808a049e authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Gustavo Padovan
Browse files

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent 9d4b68b2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);