提交 d24d8144 编写于 作者: G Gabriele Mazzotta 提交者: Marcel Holtmann

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: NGabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org # 4.0.x
上级 7f0b8a56
...@@ -1557,7 +1557,8 @@ static int hci_dev_do_close(struct hci_dev *hdev) ...@@ -1557,7 +1557,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
{ {
BT_DBG("%s %p", hdev->name, hdev); BT_DBG("%s %p", hdev->name, hdev);
if (!hci_dev_test_flag(hdev, HCI_UNREGISTER)) { if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
test_bit(HCI_UP, &hdev->flags)) {
/* Execute vendor specific shutdown routine */ /* Execute vendor specific shutdown routine */
if (hdev->shutdown) if (hdev->shutdown)
hdev->shutdown(hdev); hdev->shutdown(hdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册