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 @@ -747,6 +747,11 @@ Mtftp4Start ( goto ON_ERROR; } + // + // Set initial status. + // + Token->Status = EFI_NOT_READY; + // // Build and send an initial requests // @@ -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); }