mirror of https://github.com/acidanthera/audk.git
SourceLevelDebugPkg/Usb3: Make sure data from HW can fit in buffer
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@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:
parent
7fb7259fc0
commit
4d2b506631
|
@ -556,6 +556,13 @@ XhcDataTransfer (
|
||||||
|
|
||||||
XhcExecTransfer (Handle, Urb, Timeout);
|
XhcExecTransfer (Handle, Urb, Timeout);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Make sure the data received from HW can fit in the received buffer.
|
||||||
|
//
|
||||||
|
if (Urb->Completed > *DataLength) {
|
||||||
|
return EFI_DEVICE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
*DataLength = Urb->Completed;
|
*DataLength = Urb->Completed;
|
||||||
|
|
||||||
Status = EFI_TIMEOUT;
|
Status = EFI_TIMEOUT;
|
||||||
|
|
Loading…
Reference in New Issue