]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Bluetooth: hci_sync: Fix not able to set force_static_address
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Sat, 8 Oct 2022 01:08:43 +0000 (18:08 -0700)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 12 Dec 2022 22:19:23 +0000 (14:19 -0800)
force_static_address shall be writable while hdev is initing but is not
considered powered yet since the static address is written only when
powered.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Brian Gix <brian.gix@intel.com>
net/bluetooth/hci_debugfs.c

index 3f401ec5bb0c66e4660eb2163b783bcec69ba9d9..b7f682922a165404e9a59fe58870a0007a8fb2c8 100644 (file)
@@ -757,7 +757,7 @@ static ssize_t force_static_address_write(struct file *file,
        bool enable;
        int err;
 
-       if (test_bit(HCI_UP, &hdev->flags))
+       if (hdev_is_powered(hdev))
                return -EBUSY;
 
        err = kstrtobool_from_user(user_buf, count, &enable);