//\r
IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr;\r
if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) {\r
+ BlockData = NULL;\r
break;\r
}\r
- \r
+\r
//\r
// Get Offset/Width by Question header and OneOf Flags\r
//\r
VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset;\r
VarWidth = IfrOrderedList->MaxContainers;\r
-\r
- //\r
- // Check whether this question is in requested block array.\r
- //\r
- if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) {\r
- //\r
- // This question is not in the requested string. Skip it.\r
- //\r
- break;\r
- }\r
-\r
- //\r
- // Check this var question is in the var storage \r
- //\r
- if ((VarOffset + VarWidth) > VarStorageData->Size) {\r
- Status = EFI_INVALID_PARAMETER;\r
- goto Done;\r
- }\r
\r
//\r
// Set Block Data\r
BlockData->OpCode = IfrOpHdr->OpCode;\r
BlockData->Scope = IfrOpHdr->Scope;\r
InitializeListHead (&BlockData->DefaultValueEntry);\r
- \r
- //\r
- // Add Block Data into VarStorageData BlockEntry\r
- //\r
- InsertBlockData (&VarStorageData->BlockEntry, &BlockData);\r
break;\r
\r
case EFI_IFR_CHECKBOX_OP:\r
// Invalid ordered list option data type.\r
//\r
Status = EFI_INVALID_PARAMETER;\r
+ FreePool (BlockData);\r
goto Done;\r
}\r
+\r
//\r
// Calculate Ordered list QuestionId width.\r
//\r
BlockData->Width = (UINT16) (BlockData->Width * VarWidth);\r
+ //\r
+ // Check whether this question is in requested block array.\r
+ //\r
+ if (!BlockArrayCheck (RequestBlockArray, BlockData->Offset, BlockData->Width)) {\r
+ //\r
+ // This question is not in the requested string. Skip it.\r
+ //\r
+ FreePool (BlockData);\r
+ BlockData = NULL;\r
+ break;\r
+ }\r
+ //\r
+ // Check this var question is in the var storage \r
+ //\r
+ if ((BlockData->Offset + BlockData->Width) > VarStorageData->Size) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ FreePool (BlockData);\r
+ goto Done;\r
+ }\r
+ //\r
+ // Add Block Data into VarStorageData BlockEntry\r
+ //\r
+ InsertBlockData (&VarStorageData->BlockEntry, &BlockData);\r
+ //\r
+ // No default data for OrderedList.\r
+ //\r
BlockData = NULL;\r
break;\r
}\r