Skip to content

Commit fe2ccc6

Browse files
jhovoldVudentz
authored andcommitted
Bluetooth: fix debugfs registration
Since commit ec6cef9 ("Bluetooth: Fix SMP channel registration for unconfigured controllers") the debugfs interface for unconfigured controllers will be created when the controller is configured. There is however currently nothing preventing a controller from being configured multiple time (e.g. setting the device address using btmgmt) which results in failed attempts to register the already registered debugfs entries: debugfs: File 'features' in directory 'hci0' already present! debugfs: File 'manufacturer' in directory 'hci0' already present! debugfs: File 'hci_version' in directory 'hci0' already present! ... debugfs: File 'quirk_simultaneous_discovery' in directory 'hci0' already present! Add a controller flag to avoid trying to register the debugfs interface more than once. Fixes: ec6cef9 ("Bluetooth: Fix SMP channel registration for unconfigured controllers") Cc: [email protected] # 4.0 Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 1857c19 commit fe2ccc6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/net/bluetooth/hci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ enum {
350350
enum {
351351
HCI_SETUP,
352352
HCI_CONFIG,
353+
HCI_DEBUGFS_CREATED,
353354
HCI_AUTO_OFF,
354355
HCI_RFKILLED,
355356
HCI_MGMT,

net/bluetooth/hci_sync.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4551,6 +4551,9 @@ static int hci_init_sync(struct hci_dev *hdev)
45514551
!hci_dev_test_flag(hdev, HCI_CONFIG))
45524552
return 0;
45534553

4554+
if (hci_dev_test_and_set_flag(hdev, HCI_DEBUGFS_CREATED))
4555+
return 0;
4556+
45544557
hci_debugfs_create_common(hdev);
45554558

45564559
if (lmp_bredr_capable(hdev))

0 commit comments

Comments
 (0)