Commit 07887e92205c5808820de0be53bf326b4019d060

Authored by Eric Lapuyade
Committed by Samuel Ortiz
1 parent ac46ba4384

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: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

net/nfc/hci/command.c
... ... @@ -344,7 +344,7 @@
344 344 return -EADDRINUSE;
345 345  
346 346 if (pipe != NFC_HCI_INVALID_PIPE)
347   - goto pipe_is_open;
  347 + goto open_pipe;
348 348  
349 349 switch (dest_gate) {
350 350 case NFC_HCI_LINK_MGMT_GATE:
... ... @@ -361,6 +361,7 @@
361 361 break;
362 362 }
363 363  
  364 +open_pipe:
364 365 r = nfc_hci_open_pipe(hdev, pipe);
365 366 if (r < 0) {
366 367 if (pipe_created)
... ... @@ -371,7 +372,6 @@
371 372 return r;
372 373 }
373 374  
374   -pipe_is_open:
375 375 hdev->gate2pipe[dest_gate] = pipe;
376 376  
377 377 return 0;