summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorcinnamon shia <cinnamon.shia@hpe.com>2018-05-11 23:21:12 +0800
committerStar Zeng <star.zeng@intel.com>2018-05-14 10:04:55 +0800
commit989f7a2cf0e27123fda5ca538b15832e115e0f4e (patch)
tree3513866bd3b30c4fd480d91361a218593c680a23 /MdeModulePkg/Universal
parentd741d1419350dc4ae868d4a9396f9da33a3416a0 (diff)
downloadedk2-989f7a2cf0e27123fda5ca538b15832e115e0f4e.zip
edk2-989f7a2cf0e27123fda5ca538b15832e115e0f4e.tar.gz
edk2-989f7a2cf0e27123fda5ca538b15832e115e0f4e.tar.bz2
MdeModulePkg Variable: Fix the returned status in UpdateVariableStore
If Fvb is a NULL, return EFI_UNSUPPORTED. If the remaining size is not enough, return EFI_OUT_OF_RESOURCES. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com> Signed-off-by: Ansen Huang <ansen.huang@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 7303681..d17361f 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;
}
//