diff options
Diffstat (limited to 'net/nfc/hci/command.c')
-rw-r--r-- | net/nfc/hci/command.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/nfc/hci/command.c b/net/nfc/hci/command.c index 12cd6f3f77ec..46362ef979db 100644 --- a/net/nfc/hci/command.c +++ b/net/nfc/hci/command.c | |||
@@ -299,9 +299,9 @@ int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev) | |||
299 | } | 299 | } |
300 | EXPORT_SYMBOL(nfc_hci_disconnect_all_gates); | 300 | EXPORT_SYMBOL(nfc_hci_disconnect_all_gates); |
301 | 301 | ||
302 | int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate) | 302 | int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, |
303 | u8 pipe) | ||
303 | { | 304 | { |
304 | u8 pipe = NFC_HCI_INVALID_PIPE; | ||
305 | bool pipe_created = false; | 305 | bool pipe_created = false; |
306 | int r; | 306 | int r; |
307 | 307 | ||
@@ -310,6 +310,9 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate) | |||
310 | if (hdev->gate2pipe[dest_gate] != NFC_HCI_INVALID_PIPE) | 310 | if (hdev->gate2pipe[dest_gate] != NFC_HCI_INVALID_PIPE) |
311 | return -EADDRINUSE; | 311 | return -EADDRINUSE; |
312 | 312 | ||
313 | if (pipe != NFC_HCI_INVALID_PIPE) | ||
314 | goto pipe_is_open; | ||
315 | |||
313 | switch (dest_gate) { | 316 | switch (dest_gate) { |
314 | case NFC_HCI_LINK_MGMT_GATE: | 317 | case NFC_HCI_LINK_MGMT_GATE: |
315 | pipe = NFC_HCI_LINK_MGMT_PIPE; | 318 | pipe = NFC_HCI_LINK_MGMT_PIPE; |
@@ -335,6 +338,7 @@ int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate) | |||
335 | return r; | 338 | return r; |
336 | } | 339 | } |
337 | 340 | ||
341 | pipe_is_open: | ||
338 | hdev->gate2pipe[dest_gate] = pipe; | 342 | hdev->gate2pipe[dest_gate] = pipe; |
339 | 343 | ||
340 | return 0; | 344 | return 0; |