Skip to content

Commit f33b006

Browse files
Vudentzholtmann
authored andcommitted
Bluetooth: vhci: Fix checking of msft_opcode
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: b8f5482 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable") Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 7a517ac commit f33b006

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/bluetooth/hci_vhci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static int msft_opcode_set(void *data, u64 val)
200200
{
201201
struct vhci_data *vhci = data;
202202

203-
if (val > 0xffff || (val & 0xffff >> 10) != 0x3f)
203+
if (val > 0xffff || hci_opcode_ogf(val) != 0x3f)
204204
return -EINVAL;
205205

206206
if (vhci->msft_opcode)

0 commit comments

Comments
 (0)