Commit 1036b890 authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Gustavo Padovan

Bluetooth: Fix opcode access in hci_complete

opcode to be accessed is in le16 format so convert it
first to cpu byte order.
Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 035100c8
...@@ -83,6 +83,7 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result) ...@@ -83,6 +83,7 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result)
*/ */
if (test_bit(HCI_INIT, &hdev->flags) && hdev->init_last_cmd != cmd) { if (test_bit(HCI_INIT, &hdev->flags) && hdev->init_last_cmd != cmd) {
struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data; struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data;
u16 opcode = __le16_to_cpu(sent->opcode);
struct sk_buff *skb; struct sk_buff *skb;
/* Some CSR based controllers generate a spontaneous /* Some CSR based controllers generate a spontaneous
...@@ -92,7 +93,7 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result) ...@@ -92,7 +93,7 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result)
* command. * command.
*/ */
if (cmd != HCI_OP_RESET || sent->opcode == HCI_OP_RESET) if (cmd != HCI_OP_RESET || opcode == HCI_OP_RESET)
return; return;
skb = skb_clone(hdev->sent_cmd, GFP_ATOMIC); skb = skb_clone(hdev->sent_cmd, GFP_ATOMIC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment