|
@@ -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);
|