DM USB: xHCI: Fix an potential array out of range issue.
When usb device numbers reach up to XHCI_MAX_SLOTS. The slot_allocated array will get out of range. This patch is used to fix this issue. Tracked-On: #1479 Signed-off-by: Liang Yang <liang3.yang@intel.com> Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
84c0c87842
commit
80e02c9708
|
@ -373,7 +373,7 @@ struct pci_xhci_vdev {
|
|||
struct pci_xhci_dev_emu **devices; /* XHCI[port] = device */
|
||||
struct pci_xhci_dev_emu **slots; /* slots assigned from 1 */
|
||||
|
||||
bool slot_allocated[XHCI_MAX_SLOTS];
|
||||
bool slot_allocated[XHCI_MAX_SLOTS + 1];
|
||||
int ndevices;
|
||||
uint16_t pid;
|
||||
uint16_t vid;
|
||||
|
|
Loading…
Reference in New Issue