mirror of https://github.com/acidanthera/audk.git
MdeModulePkg Variable: Keep the behavior of Variable Dxe and SMM drivers consistent
to return EFI_NOT_FOUND when a specified variable doesn't exist and Data parameter is NULL but DataSize parameter is valid in GetVariable() invocation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17030 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
33f413f0d6
commit
82e47eb22f
|
@ -459,10 +459,6 @@ RuntimeServiceGetVariable (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((*DataSize != 0) && (Data == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
TempDataSize = *DataSize;
|
||||
VariableNameSize = StrSize (VariableName);
|
||||
SmmVariableHeader = NULL;
|
||||
|
@ -527,7 +523,11 @@ RuntimeServiceGetVariable (
|
|||
goto Done;
|
||||
}
|
||||
|
||||
CopyMem (Data, (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize, SmmVariableHeader->DataSize);
|
||||
if (Data != NULL) {
|
||||
CopyMem (Data, (UINT8 *)SmmVariableHeader->Name + SmmVariableHeader->NameSize, SmmVariableHeader->DataSize);
|
||||
} else {
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Done:
|
||||
ReleaseLockOnlyAtBootTime (&mVariableServicesLock);
|
||||
|
|
Loading…
Reference in New Issue