]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
Bluetooth: Fix debugfs entry leak in hci_register_dev()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 13 Oct 2021 08:55:46 +0000 (16:55 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:02:23 +0000 (11:02 +0100)
commitba01d73e054c63f7465bc82d030179879f1fb366
treedccb693d42993e2c10644d409644396d8440163e
parentbd27b956c2360e5e16b862450b6c2aeeb006602c
Bluetooth: Fix debugfs entry leak in hci_register_dev()

BugLink: https://bugs.launchpad.net/bugs/1959376
[ 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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/bluetooth/hci_core.c