summaryrefslogtreecommitdiff
path: root/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
diff options
context:
space:
mode:
Diffstat (limited to 'SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c')
-rw-r--r--SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c b/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
index 7ca707915e..c6f3edc756 100644
--- a/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
+++ b/SecurityPkg/Tcg/MemoryOverwriteRequestControlLock/TcgMorLock.c
@@ -144,19 +144,20 @@ SetVariableCheckHandlerMor (
}
//
+ // Delete not OK
+ //
+ if ((DataSize != sizeof(UINT8)) || (Data == NULL) || (Attributes == 0)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
// check format
//
if (IsMorLockVariable(VariableName, VendorGuid)) {
//
- // Delete not OK
- //
- if ((DataSize == 0) || (Data == NULL) || (Attributes == 0)) {
- return EFI_INVALID_PARAMETER;
- }
- //
// set to any other value not OK
//
- if ((DataSize != sizeof(UINT8)) || ((*(UINT8 *)Data != 1) && (*(UINT8 *)Data != 0))) {
+ if ((*(UINT8 *)Data != 1) && (*(UINT8 *)Data != 0)) {
return EFI_INVALID_PARAMETER;
}
}