summaryrefslogtreecommitdiff
path: root/SourceLevelDebugPkg/Library
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-21 06:59:17 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-21 06:59:17 +0000
commitec99fa8efb51379e722c6955bb66da3d3b721aea (patch)
tree5890394a00a6cd9990d26d633ce9ccc4490ec3e4 /SourceLevelDebugPkg/Library
parent3ecd0155a9a8a6858f2ec8e1fb2ec0918877a212 (diff)
downloadedk2-ec99fa8efb51379e722c6955bb66da3d3b721aea.zip
edk2-ec99fa8efb51379e722c6955bb66da3d3b721aea.tar.gz
edk2-ec99fa8efb51379e722c6955bb66da3d3b721aea.tar.bz2
fix build error.
Signed-off-by: erictian Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12401 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library')
-rw-r--r--SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
index 59189db..3dd1e3a 100644
--- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
+++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
@@ -285,7 +285,10 @@ UsbDebugPortIn (
}
*Length = (UINT8)(MmioRead32((UINTN)&DebugPortRegister->ControlStatus) & 0xF);
- ASSERT (*Length <= 8);
+ if (*Length > 8) {
+ return RETURN_DEVICE_ERROR;
+ }
+
for (Index = 0; Index < *Length; Index++) {
Buffer[Index] = DebugPortRegister->DataBuffer[Index];
}
@@ -643,7 +646,11 @@ InitializeUsbDebugHardware (
//
return Status;
}
- ASSERT (Length == sizeof(USB_DEBUG_PORT_DESCRIPTOR));
+
+ if (Length != sizeof(USB_DEBUG_PORT_DESCRIPTOR)) {
+ return RETURN_DEVICE_ERROR;
+ }
+
//
// set usb debug device address as 0x7F.
//