diff options
author | Abner Chang <abner.chang@amd.com> | 2024-03-21 19:35:39 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-04-04 14:24:31 +0000 |
commit | 2e4e41d0121ceda6907d17948b9b1b200c68c9bc (patch) | |
tree | 35771ff882296e5488fb2f276c9eef1275cce86d | |
parent | c8f56800fd3a280b1ce9ff6da7f9581304b6a40d (diff) | |
download | edk2-2e4e41d0121ceda6907d17948b9b1b200c68c9bc.tar.gz edk2-2e4e41d0121ceda6907d17948b9b1b200c68c9bc.tar.bz2 edk2-2e4e41d0121ceda6907d17948b9b1b200c68c9bc.zip |
RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly
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 <abner.chang@amd.com>
Co-authored-by: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Reviewed-by: Igor Kulchytskyy <igork@ami.com>
-rw-r--r-- | RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c index 99e7827eea..86f5d3c447 100644 --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c @@ -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;
|