diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 7651321d351c..e17f4e1e84b8 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -659,6 +659,8 @@ static int vhci_release(struct inode *inode, struct file *file) flush_work(&data->suspend_work); hdev = data->hdev; + + debugfs_remove_recursive(hdev->debugfs); if (hdev) { hci_unregister_dev(hdev); diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 18ab5628f85a..e883866a2bd2 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2724,7 +2724,6 @@ EXPORT_SYMBOL(hci_unregister_dev); /* Release HCI device */ void hci_release_dev(struct hci_dev *hdev) { - debugfs_remove_recursive(hdev->debugfs); kfree_const(hdev->hw_info); kfree_const(hdev->fw_info);