Bluetooth: hci_sync: Fix overwriting request callback
[linux-2.6-microblaze.git] / net / bluetooth / hci_event.c
index 6071a12..bffd2c7 100644 (file)
@@ -4368,7 +4368,7 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, void *data,
         * (since for this kind of commands there will not be a command
         * complete event).
         */
-       if (ev->status || (hdev->sent_cmd && !hci_skb_event(hdev->sent_cmd))) {
+       if (ev->status || (hdev->req_skb && !hci_skb_event(hdev->req_skb))) {
                hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete,
                                     req_complete_skb);
                if (hci_dev_test_flag(hdev, HCI_CMD_PENDING)) {
@@ -7170,10 +7170,10 @@ static void hci_le_meta_evt(struct hci_dev *hdev, void *data,
        bt_dev_dbg(hdev, "subevent 0x%2.2x", ev->subevent);
 
        /* Only match event if command OGF is for LE */
-       if (hdev->sent_cmd &&
-           hci_opcode_ogf(hci_skb_opcode(hdev->sent_cmd)) == 0x08 &&
-           hci_skb_event(hdev->sent_cmd) == ev->subevent) {
-               *opcode = hci_skb_opcode(hdev->sent_cmd);
+       if (hdev->req_skb &&
+           hci_opcode_ogf(hci_skb_opcode(hdev->req_skb)) == 0x08 &&
+           hci_skb_event(hdev->req_skb) == ev->subevent) {
+               *opcode = hci_skb_opcode(hdev->req_skb);
                hci_req_cmd_complete(hdev, *opcode, 0x00, req_complete,
                                     req_complete_skb);
        }
@@ -7541,10 +7541,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
        }
 
        /* Only match event if command OGF is not for LE */
-       if (hdev->sent_cmd &&
-           hci_opcode_ogf(hci_skb_opcode(hdev->sent_cmd)) != 0x08 &&
-           hci_skb_event(hdev->sent_cmd) == event) {
-               hci_req_cmd_complete(hdev, hci_skb_opcode(hdev->sent_cmd),
+       if (hdev->req_skb &&
+           hci_opcode_ogf(hci_skb_opcode(hdev->req_skb)) != 0x08 &&
+           hci_skb_event(hdev->req_skb) == event) {
+               hci_req_cmd_complete(hdev, hci_skb_opcode(hdev->req_skb),
                                     status, &req_complete, &req_complete_skb);
                req_evt = event;
        }