summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-03-09 09:53:50 +0200
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-03-09 17:19:09 -0300
commitad82cdd196cc3e31c412a091e8dd59bef0331eaa (patch)
tree1834b0afc4c719cf33e976a0874718777ef243fa /net/bluetooth
parent34739c1effcbdc6d210324e86514fa2d2d47b12b (diff)
downloadlinux-3.10-ad82cdd196cc3e31c412a091e8dd59bef0331eaa.tar.gz
linux-3.10-ad82cdd196cc3e31c412a091e8dd59bef0331eaa.tar.bz2
linux-3.10-ad82cdd196cc3e31c412a091e8dd59bef0331eaa.zip
Bluetooth: Fix endianness handling of cmd_status/complete opcodes
The opcode in cmd_complete and cmd_status events is 16 bits, so we should only be comparing it after having converted it to the host endianness. There's already an opcode variable in both functions which is in host endiannes so the right fix is to just start using it instead of ev->opcode. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_event.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index e89707f3394..d11b87bc1d1 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2299,10 +2299,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
break;
}
- if (ev->opcode != HCI_OP_NOP)
+ if (opcode != HCI_OP_NOP)
del_timer(&hdev->cmd_timer);
- hci_req_cmd_complete(hdev, ev->opcode, status);
+ hci_req_cmd_complete(hdev, opcode, status);
if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
atomic_set(&hdev->cmd_cnt, 1);
@@ -2386,10 +2386,10 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
break;
}
- if (ev->opcode != HCI_OP_NOP)
+ if (opcode != HCI_OP_NOP)
del_timer(&hdev->cmd_timer);
- hci_req_cmd_status(hdev, ev->opcode, ev->status);
+ hci_req_cmd_status(hdev, opcode, ev->status);
if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
atomic_set(&hdev->cmd_cnt, 1);