mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
NFC: Small nfc_hci_create_pipe refactoring
Check for error and return if any. This makes it easier to see what is a 'positive' function flow. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
36b05114d1
commit
80e4232ecb
@ -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 *) ¶ms, sizeof(params), &skb);
|
||||
if (*result == 0) {
|
||||
resp = (struct hci_create_pipe_resp *)skb->data;
|
||||
pipe = resp->pipe;
|
||||
kfree_skb(skb);
|
||||
|
||||
pr_debug("pipe created=%d\n", pipe);
|
||||
|
||||
return pipe;
|
||||
} else
|
||||
if (*result < 0)
|
||||
return NFC_HCI_INVALID_PIPE;
|
||||
|
||||
resp = (struct hci_create_pipe_resp *)skb->data;
|
||||
pipe = resp->pipe;
|
||||
kfree_skb(skb);
|
||||
|
||||
pr_debug("pipe created=%d\n", pipe);
|
||||
|
||||
return pipe;
|
||||
}
|
||||
|
||||
static int nfc_hci_delete_pipe(struct nfc_hci_dev *hdev, u8 pipe)
|
||||
|
Loading…
Reference in New Issue
Block a user