diff options
| author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-10-13 16:55:46 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-27 09:00:53 +0100 |
| commit | 91c1a802d09bed451009d82336e1216e7f3adc84 (patch) | |
| tree | a4134ae2f5c40c293f5933b2b50a6116a4fc1f23 /net | |
| parent | 001d3327cc77e85f3185fe0c1e793bba387fe2ab (diff) | |
| download | linux-91c1a802d09bed451009d82336e1216e7f3adc84.tar.gz linux-91c1a802d09bed451009d82336e1216e7f3adc84.tar.bz2 linux-91c1a802d09bed451009d82336e1216e7f3adc84.zip | |
Bluetooth: Fix debugfs entry leak in hci_register_dev()
[ Upstream commit 5a4bb6a8e981d3d0d492aa38412ee80b21033177 ]
Fault injection test report debugfs entry leak as follows:
debugfs: Directory 'hci0' with parent 'bluetooth' already present!
When register_pm_notifier() failed in hci_register_dev(), the debugfs
create by debugfs_create_dir() do not removed in the error handing path.
Add the remove debugfs code to fix it.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/bluetooth/hci_core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 1906adfd553a..687b4d0e4c67 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3183,6 +3183,7 @@ int hci_register_dev(struct hci_dev *hdev) return id; err_wqueue: + debugfs_remove_recursive(hdev->debugfs); destroy_workqueue(hdev->workqueue); destroy_workqueue(hdev->req_workqueue); err: |
