Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: MGMT: Fix not exposing debug UUID on MGMT_OP_READ_EXP_FEATURES_INFO

The debug UUID was only getting set if MGMT_OP_READ_EXP_FEATURES_INFO
was not called with a specific index which breaks the likes of
bluetoothd since it only invokes MGMT_OP_READ_EXP_FEATURES_INFO when an
adapter is plugged, so instead of depending hdev not to be set just
enable the UUID on any index like it was done with iso_sock_uuid.

Fixes: e625e50ceee1 ("Bluetooth: Introduce debug feature when dynamic debug is disabled")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

+4 -6
+4 -6
net/bluetooth/mgmt.c
··· 4542 4542 return -ENOMEM; 4543 4543 4544 4544 #ifdef CONFIG_BT_FEATURE_DEBUG 4545 - if (!hdev) { 4546 - flags = bt_dbg_get() ? BIT(0) : 0; 4545 + flags = bt_dbg_get() ? BIT(0) : 0; 4547 4546 4548 - memcpy(rp->features[idx].uuid, debug_uuid, 16); 4549 - rp->features[idx].flags = cpu_to_le32(flags); 4550 - idx++; 4551 - } 4547 + memcpy(rp->features[idx].uuid, debug_uuid, 16); 4548 + rp->features[idx].flags = cpu_to_le32(flags); 4549 + idx++; 4552 4550 #endif 4553 4551 4554 4552 if (hdev && hci_dev_le_state_simultaneous(hdev)) {