summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko2012-03-12 14:59:33 +0100
committerGustavo Padovan2012-05-09 05:41:32 +0200
commit1036b89042df96e71c0cb941be212f8053ecccc0 (patch)
tree9e438432d2e5e9f0b452c2a2a9df2adfc1c6b7e3 /net/bluetooth/hci_core.c
parentBluetooth: Fix type in cpu_to_le conversion (diff)
downloadkernel-qcow2-linux-1036b89042df96e71c0cb941be212f8053ecccc0.tar.gz
kernel-qcow2-linux-1036b89042df96e71c0cb941be212f8053ecccc0.tar.xz
kernel-qcow2-linux-1036b89042df96e71c0cb941be212f8053ecccc0.zip
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: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index af55ea1b6882..47a4e9b26b9a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -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) {
struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data;
+ u16 opcode = __le16_to_cpu(sent->opcode);
struct sk_buff *skb;
/* Some CSR based controllers generate a spontaneous
@@ -92,7 +93,7 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result)
* command.
*/
- if (cmd != HCI_OP_RESET || sent->opcode == HCI_OP_RESET)
+ if (cmd != HCI_OP_RESET || opcode == HCI_OP_RESET)
return;
skb = skb_clone(hdev->sent_cmd, GFP_ATOMIC);