summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
index 3c2b4e1019..a0ec216e07 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
@@ -748,6 +748,11 @@ Mtftp4Start (
}
//
+ // Set initial status.
+ //
+ Token->Status = EFI_NOT_READY;
+
+ //
// Build and send an initial requests
//
if (Operation == EFI_MTFTP4_OPCODE_WRQ) {
@@ -761,16 +766,15 @@ Mtftp4Start (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
- //
- // Return immediately for asynchronous operation or poll the
- // instance for synchronous operation.
- //
- Token->Status = EFI_NOT_READY;
if (Token->Event != NULL) {
return EFI_SUCCESS;
}
+ //
+ // Return immediately for asynchronous operation or poll the
+ // instance for synchronous operation.
+ //
while (Token->Status == EFI_NOT_READY) {
This->Poll (This);
}