diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-10-02 09:43:39 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-10-02 09:43:39 +0200 |
commit | b429f71bca5a4ddd914350a39572692e2ea211e0 (patch) | |
tree | 50cee6fb7b114ad89c778de87bcb44972b7326f5 /net/nfc/hci/core.c | |
parent | ace8031099f91480799b5929b4cccf2dcacc5136 (diff) | |
parent | 6fd98e775f24fd41520928d345f5db3ff52bb35d (diff) | |
download | blackbird-obmc-linux-b429f71bca5a4ddd914350a39572692e2ea211e0.tar.gz blackbird-obmc-linux-b429f71bca5a4ddd914350a39572692e2ea211e0.zip |
Merge branch 'sched/urgent' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/nfc/hci/core.c')
-rw-r--r-- | net/nfc/hci/core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index ac8030c4bcf8..19cb2e473ea6 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c @@ -209,6 +209,11 @@ void nfc_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, } create_info = (struct hci_create_pipe_resp *)skb->data; + if (create_info->pipe >= NFC_HCI_MAX_PIPES) { + status = NFC_HCI_ANY_E_NOK; + goto exit; + } + /* Save the new created pipe and bind with local gate, * the description for skb->data[3] is destination gate id * but since we received this cmd from host controller, we @@ -232,6 +237,11 @@ void nfc_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, } delete_info = (struct hci_delete_pipe_noti *)skb->data; + if (delete_info->pipe >= NFC_HCI_MAX_PIPES) { + status = NFC_HCI_ANY_E_NOK; + goto exit; + } + hdev->pipes[delete_info->pipe].gate = NFC_HCI_INVALID_GATE; hdev->pipes[delete_info->pipe].dest_host = NFC_HCI_INVALID_HOST; break; |