NFC: st21nfca: Open NFC_HCI_LINK_MGMT_PIPE
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Oct 2015 21:54:29 +0000 (22:54 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Oct 2015 05:53:15 +0000 (06:53 +0100)
NFC_HCI_LINK_MGMT_PIPE was never opened in nfc_hci_load_session.

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

index 67d1c27a41eed894ddcff1e67b2a7af8612124bb..819a94af3964afd6e816e84c2b80690a1fe8f27f 100644 (file)
@@ -203,22 +203,13 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
        }
 
        /*
-        * 3 gates have a well known pipe ID.
-        * They will never appear in the pipe list
+        * 3 gates have a well known pipe ID. Only NFC_HCI_LINK_MGMT_GATE
+        * is not yet open at this stage.
         */
-       if (skb_pipe_list->len + 3 < ARRAY_SIZE(st21nfca_gates)) {
-               for (i = skb_pipe_list->len + 3;
-                               i < ARRAY_SIZE(st21nfca_gates) - 2; i++) {
-                       r = nfc_hci_connect_gate(hdev,
-                                       NFC_HCI_HOST_CONTROLLER_ID,
-                                       st21nfca_gates[i].gate,
-                                       st21nfca_gates[i].pipe);
-                       if (r < 0)
-                               goto free_list;
-               }
-       }
+       r = nfc_hci_connect_gate(hdev, NFC_HCI_HOST_CONTROLLER_ID,
+                                NFC_HCI_LINK_MGMT_GATE,
+                                NFC_HCI_LINK_MGMT_PIPE);
 
-free_list:
        kfree_skb(skb_pipe_list);
        return r;
 }