summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/SerialDxe
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-08 21:12:11 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-08 21:12:11 +0000
commitf65dc3bebd97e5b9951fa44bb6365275f7f00791 (patch)
treee022bb92db67e5e788d362087bf4f9134c017b9c /EmbeddedPkg/SerialDxe
parent420462d0fbc56ded2fe9283928c058b06ab27f61 (diff)
downloadedk2-platforms-f65dc3bebd97e5b9951fa44bb6365275f7f00791.tar.xz
Fix bug in SerialRead returning error if no data was present.
No data should not be an error return. Causing lots of REPORT_STATUS_CODE messages out of the TerminalDxe driver. Signed-off-by: andrewfish Reviewed-by: andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11770 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg/SerialDxe')
-rw-r--r--EmbeddedPkg/SerialDxe/SerialIo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/EmbeddedPkg/SerialDxe/SerialIo.c b/EmbeddedPkg/SerialDxe/SerialIo.c
index b9ea4b9c42..fe0b1711a8 100644
--- a/EmbeddedPkg/SerialDxe/SerialIo.c
+++ b/EmbeddedPkg/SerialDxe/SerialIo.c
@@ -193,8 +193,12 @@ SerialRead (
if (SerialPortPoll()) {
Count = SerialPortRead (Buffer, *BufferSize);
*BufferSize = Count;
+ return (Count == 0) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
}
- return (Count == 0) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
+
+ // No data to return
+ *BufferSize = 0;
+ return EFI_SUCCESS;
}