diff mbox series

Bluetooth: vhci: Fix checking of msft_opcode

Message ID 20211021184435.614575-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Delegated to: Marcel Holtmann
Headers show
Series Bluetooth: vhci: Fix checking of msft_opcode | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint fail Bluetooth: vhci: Fix checking of msft_opcode 11: B1 Line exceeds max length (93>80): "Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")"
tedd_an/buildkernel success Build Kernel PASS
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 468, Passed: 0 (0.0%), Failed: 0, Not Run: 468
tedd_an/testrunnerrfcomm-tester success Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Luiz Augusto von Dentz Oct. 21, 2021, 6:44 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

msft_opcode shall be use a vendor ogf (0x3f) but the check was
swifting the bits in the wrong order due to a missing parantesis
over val & 0xffff, but since the code already checks for values over
0xffff it shall not be necessary to perform that operation it now just
removes which makes it work properly when setting opcodes like 0xfce1.

Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 drivers/bluetooth/hci_vhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Oct. 21, 2021, 7:10 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=568117

---Test result---

Test Summary:
CheckPatch                    PASS      2.05 seconds
GitLint                       FAIL      2.15 seconds
BuildKernel                   PASS      547.67 seconds
TestRunner: Setup             PASS      412.76 seconds
TestRunner: l2cap-tester      PASS      9.52 seconds
TestRunner: bnep-tester       PASS      5.16 seconds
TestRunner: mgmt-tester       PASS      44.87 seconds
TestRunner: rfcomm-tester     PASS      6.15 seconds
TestRunner: sco-tester        PASS      6.35 seconds
TestRunner: smp-tester        PASS      6.11 seconds
TestRunner: userchan-tester   PASS      5.30 seconds

Details
##############################
Test: GitLint - FAIL - 2.15 seconds
Run gitlint with rule in .gitlint
Bluetooth: vhci: Fix checking of msft_opcode
11: B1 Line exceeds max length (93>80): "Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")"




---
Regards,
Linux Bluetooth
Marcel Holtmann Oct. 22, 2021, 4:47 a.m. UTC | #2
Hi Luiz,

> msft_opcode shall be use a vendor ogf (0x3f) but the check was
> swifting the bits in the wrong order due to a missing parantesis
> over val & 0xffff, but since the code already checks for values over
> 0xffff it shall not be necessary to perform that operation it now just
> removes which makes it work properly when setting opcodes like 0xfce1.
> 
> Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> drivers/bluetooth/hci_vhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel
diff mbox series

Patch

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 9cb7c8fafbf9..49ac884d996e 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -200,7 +200,7 @@  static int msft_opcode_set(void *data, u64 val)
 {
 	struct vhci_data *vhci = data;
 
-	if (val > 0xffff || (val & 0xffff >> 10) != 0x3f)
+	if (val > 0xffff || hci_opcode_ogf(val) != 0x3f)
 		return -EINVAL;
 
 	if (vhci->msft_opcode)