NFC: nci: extract pipe value using NCI_HCP_MSG_GET_PIPE
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Oct 2015 21:54:22 +0000 (22:54 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Oct 2015 05:53:12 +0000 (06:53 +0100)
When receiving data in nci_hci_msg_rx_work, extract pipe
value using NCI_HCP_MSG_GET_PIPE macro.

Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/nci/hci.c

index b07092f4111bd212abe9799da7c1286885120b0f..30b09f04c142d087b04135204db99ad494d4e974 100644 (file)
@@ -402,7 +402,7 @@ static void nci_hci_msg_rx_work(struct work_struct *work)
        u8 pipe, type, instruction;
 
        while ((skb = skb_dequeue(&hdev->msg_rx_queue)) != NULL) {
-               pipe = skb->data[0];
+               pipe = NCI_HCP_MSG_GET_PIPE(skb->data[0]);
                skb_pull(skb, NCI_HCI_HCP_PACKET_HEADER_LEN);
                message = (struct nci_hcp_message *)skb->data;
                type = NCI_HCP_MSG_GET_TYPE(message->header);
@@ -439,7 +439,7 @@ void nci_hci_data_received_cb(void *context,
 
        /* it's the last fragment. Does it need re-aggregation? */
        if (skb_queue_len(&ndev->hci_dev->rx_hcp_frags)) {
-               pipe = packet->header & NCI_HCI_FRAGMENT;
+               pipe = NCI_HCP_MSG_GET_PIPE(packet->header);
                skb_queue_tail(&ndev->hci_dev->rx_hcp_frags, skb);
 
                msg_len = 0;
This page took 0.02478 seconds and 5 git commands to generate.