提交 07887e92 编写于 作者: E Eric Lapuyade 提交者: Samuel Ortiz

NFC: Fix hci_connect_gate() when a pre-opened pipe is passed

In some cases, pre-opened pipes don't stay open when a clear all pipes
command is sent. They stay created however. Therefore, one can never
assume that such a pipe is already open. As re-opening a pipe seems not
to be a problem, we do that now.
Signed-off-by: NEric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 ac46ba43
...@@ -344,7 +344,7 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, ...@@ -344,7 +344,7 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate,
return -EADDRINUSE; return -EADDRINUSE;
if (pipe != NFC_HCI_INVALID_PIPE) if (pipe != NFC_HCI_INVALID_PIPE)
goto pipe_is_open; goto open_pipe;
switch (dest_gate) { switch (dest_gate) {
case NFC_HCI_LINK_MGMT_GATE: case NFC_HCI_LINK_MGMT_GATE:
...@@ -361,6 +361,7 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, ...@@ -361,6 +361,7 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate,
break; break;
} }
open_pipe:
r = nfc_hci_open_pipe(hdev, pipe); r = nfc_hci_open_pipe(hdev, pipe);
if (r < 0) { if (r < 0) {
if (pipe_created) if (pipe_created)
...@@ -371,7 +372,6 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, ...@@ -371,7 +372,6 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate,
return r; return r;
} }
pipe_is_open:
hdev->gate2pipe[dest_gate] = pipe; hdev->gate2pipe[dest_gate] = pipe;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册