diff options
author | David S. Miller <davem@davemloft.net> | 2019-04-09 02:39:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-09 02:39:36 -0400 |
commit | 310655b07ae8ef0b8fdb641b610ded2052215664 (patch) | |
tree | d9b7a500ef21a087a337e1f1bb9218000cf1c03d /net/nfc | |
parent | 7f301cff1fc20c5b91203c5e610cf95782081d5d (diff) | |
parent | 869e3305f23dfeacdaa234717c92ccb237815d90 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/nci/hci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index ddfc52ac1f9b..c0d323b58e73 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c | |||
@@ -312,6 +312,10 @@ static void nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe, | |||
312 | create_info = (struct nci_hci_create_pipe_resp *)skb->data; | 312 | create_info = (struct nci_hci_create_pipe_resp *)skb->data; |
313 | dest_gate = create_info->dest_gate; | 313 | dest_gate = create_info->dest_gate; |
314 | new_pipe = create_info->pipe; | 314 | new_pipe = create_info->pipe; |
315 | if (new_pipe >= NCI_HCI_MAX_PIPES) { | ||
316 | status = NCI_HCI_ANY_E_NOK; | ||
317 | goto exit; | ||
318 | } | ||
315 | 319 | ||
316 | /* Save the new created pipe and bind with local gate, | 320 | /* Save the new created pipe and bind with local gate, |
317 | * the description for skb->data[3] is destination gate id | 321 | * the description for skb->data[3] is destination gate id |
@@ -336,6 +340,10 @@ static void nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe, | |||
336 | goto exit; | 340 | goto exit; |
337 | } | 341 | } |
338 | delete_info = (struct nci_hci_delete_pipe_noti *)skb->data; | 342 | delete_info = (struct nci_hci_delete_pipe_noti *)skb->data; |
343 | if (delete_info->pipe >= NCI_HCI_MAX_PIPES) { | ||
344 | status = NCI_HCI_ANY_E_NOK; | ||
345 | goto exit; | ||
346 | } | ||
339 | 347 | ||
340 | ndev->hci_dev->pipes[delete_info->pipe].gate = | 348 | ndev->hci_dev->pipes[delete_info->pipe].gate = |
341 | NCI_HCI_INVALID_GATE; | 349 | NCI_HCI_INVALID_GATE; |