mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
DM USB: xHCI: Fix XHCI_GET_SLOT value check issue
Fix XHCI_GET_SLOT macro check slot valid function, when the slot value is bigger than XHCI_MAX_SLOT set the slot value to zero. Tracked-On: #4711 Signed-off-by: Long Liu <long.liu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
3c9469d98a
commit
f9c44369a0
@ -2523,7 +2523,8 @@ done:
|
|||||||
|
|
||||||
#define XHCI_GET_SLOT(xdev, trb, slot, cmderr) \
|
#define XHCI_GET_SLOT(xdev, trb, slot, cmderr) \
|
||||||
do { \
|
do { \
|
||||||
slot = (XHCI_TRB_3_SLOT_GET(trb->dwTrb3)) ? 0 : \
|
slot = (XHCI_TRB_3_SLOT_GET(trb->dwTrb3) > \
|
||||||
|
XHCI_MAX_SLOTS) ? 0 : \
|
||||||
XHCI_TRB_3_SLOT_GET(trb->dwTrb3); \
|
XHCI_TRB_3_SLOT_GET(trb->dwTrb3); \
|
||||||
if (!slot) \
|
if (!slot) \
|
||||||
cmderr = XHCI_TRB_ERROR_INVALID; \
|
cmderr = XHCI_TRB_ERROR_INVALID; \
|
||||||
|
Loading…
Reference in New Issue
Block a user