MdeModulePkg/Usb: Make sure data from HW is no more than expected
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -1556,9 +1556,12 @@ XhcMonitorAsyncRequests (
|
||||
//
|
||||
ProcBuf = NULL;
|
||||
if (Urb->Result == EFI_USB_NOERROR) {
|
||||
ASSERT (Urb->Completed <= Urb->DataLen);
|
||||
|
||||
ProcBuf = AllocateZeroPool (Urb->Completed);
|
||||
//
|
||||
// Make sure the data received from HW is no more than expected.
|
||||
//
|
||||
if (Urb->Completed <= Urb->DataLen) {
|
||||
ProcBuf = AllocateZeroPool (Urb->Completed);
|
||||
}
|
||||
|
||||
if (ProcBuf == NULL) {
|
||||
XhcUpdateAsyncRequest (Xhc, Urb);
|
||||
|
Reference in New Issue
Block a user