Skip to content

Commit

Permalink
NFC: Small nfc_hci_create_pipe refactoring
Browse files Browse the repository at this point in the history
Check for error and return if any. This makes it easier to see what is
a 'positive' function flow.

Signed-off-by: Szymon Janc <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
Szymon Janc authored and Samuel Ortiz committed Oct 26, 2012
1 parent 36b0511 commit 80e4232
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions net/nfc/hci/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,16 @@ static u8 nfc_hci_create_pipe(struct nfc_hci_dev *hdev, u8 dest_host,
*result = nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE,
NFC_HCI_ADM_CREATE_PIPE,
(u8 *) &params, sizeof(params), &skb);
if (*result == 0) {
resp = (struct hci_create_pipe_resp *)skb->data;
pipe = resp->pipe;
kfree_skb(skb);
if (*result < 0)
return NFC_HCI_INVALID_PIPE;

pr_debug("pipe created=%d\n", pipe);
resp = (struct hci_create_pipe_resp *)skb->data;
pipe = resp->pipe;
kfree_skb(skb);

return pipe;
} else
return NFC_HCI_INVALID_PIPE;
pr_debug("pipe created=%d\n", pipe);

return pipe;
}

static int nfc_hci_delete_pipe(struct nfc_hci_dev *hdev, u8 pipe)
Expand Down

0 comments on commit 80e4232

Please sign in to comment.