Skip to content

Commit d24d814

Browse files
gm-vmholtmann
authored andcommitted
Bluetooth: Skip the shutdown routine if the interface is not up
Most likely, the shutdown routine requires the interface to be up. This is the case for BTUSB_INTEL: the routine tries to send a command to the interface, but since this one is down, it fails and exits once HCI_INIT_TIMEOUT has expired. Signed-off-by: Gabriele Mazzotta <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Cc: [email protected] # 4.0.x
1 parent 7f0b8a5 commit d24d814

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bluetooth/hci_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
15571557
{
15581558
BT_DBG("%s %p", hdev->name, hdev);
15591559

1560-
if (!hci_dev_test_flag(hdev, HCI_UNREGISTER)) {
1560+
if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
1561+
test_bit(HCI_UP, &hdev->flags)) {
15611562
/* Execute vendor specific shutdown routine */
15621563
if (hdev->shutdown)
15631564
hdev->shutdown(hdev);

0 commit comments

Comments
 (0)