]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Fix opcode access in hci_complete
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Mon, 12 Mar 2012 13:59:33 +0000 (15:59 +0200)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 28 Mar 2012 14:39:09 +0000 (11:39 -0300)
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>
net/bluetooth/hci_core.c

index 2f3e1bb02462752bf83ad04fc9d63117f6af4548..149d7492b9e671a614330f244a4c3915d6f3061e 100644 (file)
@@ -84,6 +84,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
@@ -93,7 +94,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);