diff options
author | Jani Nikula <jani.nikula@intel.com> | 2018-11-02 09:00:55 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2018-11-02 09:01:28 +0200 |
commit | 7a085c3aad94cce7e11031c6800e41668418ae4c (patch) | |
tree | b3474f8bd622f87ad39227057f9de60959c8bd95 /net/nfc/hci/core.c | |
parent | 18cde299df33ff73908f7e5dcebf321fb79ed36c (diff) | |
parent | f9885ef875e9160454392f85159163674159c51f (diff) | |
download | linux-stable-7a085c3aad94cce7e11031c6800e41668418ae4c.tar.gz linux-stable-7a085c3aad94cce7e11031c6800e41668418ae4c.tar.bz2 linux-stable-7a085c3aad94cce7e11031c6800e41668418ae4c.zip |
Merge drm/drm-next into drm-intel-next-queued
Although there's nothing crucial missing, it's been a long time since
the last backmerge. Catch up with drm-next.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
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; |