diff mbox series

Bluetooth: vhci: Fix checking of msft_opcode

Message ID 20211020183453.324777-1-luiz.dentz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Bluetooth: vhci: Fix checking of msft_opcode | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
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: 468 (100.0%), Failed: 0, Not Run: 0
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. 20, 2021, 6:34 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.

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. 20, 2021, 7:18 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=567239

---Test result---

Test Summary:
CheckPatch                    PASS      0.70 seconds
GitLint                       PASS      0.38 seconds
BuildKernel                   PASS      746.53 seconds
TestRunner: Setup             PASS      530.38 seconds
TestRunner: l2cap-tester      PASS      11.74 seconds
TestRunner: bnep-tester       PASS      6.20 seconds
TestRunner: mgmt-tester       PASS      107.06 seconds
TestRunner: rfcomm-tester     PASS      7.08 seconds
TestRunner: sco-tester        PASS      7.91 seconds
TestRunner: smp-tester        PASS      7.51 seconds
TestRunner: userchan-tester   PASS      6.27 seconds



---
Regards,
Linux Bluetooth
Marcel Holtmann Oct. 21, 2021, 4:39 p.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.

please add Fixes: tag here.

> 
> 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(-)
> 
> diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
> index 9cb7c8fafbf9..0eb90e7c3c82 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 || (val >> 10) != 0x3f)

Then lets use hci_opcode_ogf(val) != 0x3f.

Regards

Marcel
diff mbox series

Patch

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 9cb7c8fafbf9..0eb90e7c3c82 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 || (val >> 10) != 0x3f)
 		return -EINVAL;
 
 	if (vhci->msft_opcode)