Skip to content

Commit

Permalink
RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly
Browse files Browse the repository at this point in the history
Add the condition check when delete HII string.
Only when the HiiStatement operand equal to "EFI_IFR_STRING_OP"
and the statement value type = EFI_IFR_TYPE_STRING.

Signed-off-by: Abner Chang <[email protected]>
Co-authored-by: Nickle Wang <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
Reviewed-by: Nickle Wang <[email protected]>
Reviewed-by: Igor Kulchytskyy <[email protected]>
  • Loading branch information
2 people authored and mergify[bot] committed Apr 4, 2024
1 parent c8f5680 commit 2e4e41d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1873,8 +1873,11 @@ RedfishPlatformConfigSetStatementCommon (
DEBUG ((DEBUG_ERROR, "%a: failed to save question value: %r\n", __func__, Status));
}

if (StatementValue->Value.string != 0) {
HiiDeleteString (StatementValue->Value.string, TargetStatement->ParentForm->ParentFormset->HiiHandle);
if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && (StatementValue->Type == EFI_IFR_TYPE_STRING)) {
if (StatementValue->Value.string != 0) {
// Delete HII string which was created for HII statement operand = EFI_IFR_STRING_OP and Type = EFI_IFR_TYPE_STRING.
HiiDeleteString (StatementValue->Value.string, TargetStatement->ParentForm->ParentFormset->HiiHandle);
}
}

return Status;
Expand Down

0 comments on commit 2e4e41d

Please sign in to comment.