diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 7303681aaa..d17361f805 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -238,6 +238,8 @@ IsValidVariableHeader ( @param Buffer Pointer to the buffer from which data is written. @retval EFI_INVALID_PARAMETER Parameters not valid. + @retval EFI_UNSUPPORTED Fvb is a NULL for Non-Volatile variable update. + @retval EFI_OUT_OF_RESOURCES The remaining size is not enough. @retval EFI_SUCCESS Variable store successfully updated. **/ @@ -274,7 +276,7 @@ UpdateVariableStore ( // if (!Volatile) { if (Fvb == NULL) { - return EFI_INVALID_PARAMETER; + return EFI_UNSUPPORTED; } Status = Fvb->GetPhysicalAddress(Fvb, &FvVolHdr); ASSERT_EFI_ERROR (Status); @@ -289,7 +291,7 @@ UpdateVariableStore ( } if ((DataPtr + DataSize) > ((EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) FwVolHeader + FwVolHeader->FvLength))) { - return EFI_INVALID_PARAMETER; + return EFI_OUT_OF_RESOURCES; } } else { // @@ -302,7 +304,7 @@ UpdateVariableStore ( } if ((DataPtr + DataSize) > ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))) { - return EFI_INVALID_PARAMETER; + return EFI_OUT_OF_RESOURCES; } //