Message ID | 20211013003055.2664728-2-luiz.dentz@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Luiz Von Dentz |
Headers | show |
Series | [v2,1/4] Bluetooth: Only allow setting msft_opcode at setup stage | expand |
Context | Check | Description |
---|---|---|
tedd_an/checkpatch | success | Checkpatch PASS |
tedd_an/gitlint | success | Gitlint PASS |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index eb5d4ea88c3a..ac81745d2ac4 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1283,11 +1283,16 @@ static inline int hci_set_msft_opcode(struct hci_dev *hdev, __u16 opcode) return 0; } -static inline void hci_set_aosp_capable(struct hci_dev *hdev) +static inline int hci_set_aosp_capable(struct hci_dev *hdev) { + if (!hci_dev_test_flag(hdev, HCI_SETUP)) + return -EPERM; + #if IS_ENABLED(CONFIG_BT_AOSPEXT) hdev->aosp_capable = true; #endif + + return 0; } int hci_dev_open(__u16 dev);