DM: xHCI: array bound checking before it is used
Array index of "vbdp_devs" may be out of bounds if "i >= XHCI_MAX_VIRT_PORTS", so index checking is necessary. Tracked-On: #1252 Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
8ed393a03d
commit
01c8f546e0
|
@ -721,6 +721,9 @@ xhci_vbdp_thread(void *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i >= XHCI_MAX_VIRT_PORTS)
|
||||||
|
continue;
|
||||||
|
|
||||||
j = pci_xhci_get_native_port_index_by_path(xdev,
|
j = pci_xhci_get_native_port_index_by_path(xdev,
|
||||||
&xdev->vbdp_devs[i].path);
|
&xdev->vbdp_devs[i].path);
|
||||||
if (j < 0)
|
if (j < 0)
|
||||||
|
|
Loading…
Reference in New Issue