Change MnpGetModeData() handling of return status from SnpStatus to not consider EFI_NOT_STARTED an error, similar to how Ip4ConfigDriverBindingStart() handles it.
Without this change, Ip4ConfigDriverBindingStart() considers the Mnp->GetModeData successful even though the SnpMode parameter is unchanged, and is full of unitialized stack data.
If this change is not correct, then other error handling changes need to be made in Ip4ConfigDriverBindingStart() so that uninitialized data from the stack is not used.
Signed-off-by: Roy Franz roy.franz@linaro.org Contributed-under: TianoCore Contribution Agreement 1.0 --- MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c index 795f063..c628991 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c @@ -80,7 +80,7 @@ MnpGetModeData ( // will be updated to reflect any change of media status // Status = Snp->GetStatus (Snp, &InterruptStatus, NULL); - if (!EFI_ERROR (Status)) { + if (!EFI_ERROR (Status) || (Status == EFI_NOT_STARTED)) { CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData)); } }