aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-03-09 02:53:50 -0500
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-03-09 15:19:09 -0500
commitad82cdd196cc3e31c412a091e8dd59bef0331eaa (patch)
tree1834b0afc4c719cf33e976a0874718777ef243fa
parent34739c1effcbdc6d210324e86514fa2d2d47b12b (diff)
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>
-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 e89707f3394f..d11b87bc1d1a 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)
2299 break; 2299 break;
2300 } 2300 }
2301 2301
2302 if (ev->opcode != HCI_OP_NOP) 2302 if (opcode != HCI_OP_NOP)
2303 del_timer(&hdev->cmd_timer); 2303 del_timer(&hdev->cmd_timer);
2304 2304
2305 hci_req_cmd_complete(hdev, ev->opcode, status); 2305 hci_req_cmd_complete(hdev, opcode, status);
2306 2306
2307 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) { 2307 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
2308 atomic_set(&hdev->cmd_cnt, 1); 2308 atomic_set(&hdev->cmd_cnt, 1);
@@ -2386,10 +2386,10 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
2386 break; 2386 break;
2387 } 2387 }
2388 2388
2389 if (ev->opcode != HCI_OP_NOP) 2389 if (opcode != HCI_OP_NOP)
2390 del_timer(&hdev->cmd_timer); 2390 del_timer(&hdev->cmd_timer);
2391 2391
2392 hci_req_cmd_status(hdev, ev->opcode, ev->status); 2392 hci_req_cmd_status(hdev, opcode, ev->status);
2393 2393
2394 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) { 2394 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
2395 atomic_set(&hdev->cmd_cnt, 1); 2395 atomic_set(&hdev->cmd_cnt, 1);