diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c index 82fddb169a..ae81693bfb 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c @@ -669,7 +669,9 @@ EfiPxeBcDiscover ( ); } - if (!EFI_ERROR (Status)) { + if (EFI_ERROR (Status)) { + return Status; + } else { // // Parse the cached PXE reply packet, and store it into mode data if valid. // @@ -937,6 +939,10 @@ EfiPxeBcMtftp ( Mode->IcmpErrorReceived = TRUE; } + if (EFI_ERROR (Status)) { + return Status; + } + if (Mode->UsingIpv6) { Status = Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData); } else {