:p
atchew
Login
This patch set contains minor fixes and the one major change related to BIOS resources provisioning. PR: https://github.com/tianocore/edk2-redfish-client/pull/64 Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nickle Wang <nicklew@nvidia.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112573): https://edk2.groups.io/g/devel/message/112573 Mute This Topic: https://groups.io/mt/103181637/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Initially RedfishPlatformConfigGetConfigureLang could return success even if ConfigureLangList is empty. After fixing this condition, RedfishPlatformConfigGetConfigureLang returns an error, but this doesn't help to avoid ASSERT because the error path is the same as for non-empty list. Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nickle Wang <nicklew@nvidia.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> --- .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c @@ -XXX,XX +XXX,XX @@ LeaveFunction: FreePool (ConfigureLangBuffer); } - FreePool (ConfigureLangList); + if (ConfigureLangList != NULL) { + FreePool (ConfigureLangList); + } *NumberOfValues = (UINT32)ListCount; return FirstEmptyPropKeyValueList; -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112574): https://edk2.groups.io/g/devel/message/112574 Mute This Topic: https://groups.io/mt/103181638/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nickle Wang <nicklew@nvidia.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> --- RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -XXX,XX +XXX,XX @@ EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler = { **/ VOID EFIAPI -EfiRestJasonStructureProtocolIsReady ( +EfiRestJsonStructureProtocolIsReady ( IN EFI_EVENT Event, IN VOID *Context ) @@ -XXX,XX +XXX,XX @@ RedfishResourceEntryPoint ( EfiCreateProtocolNotifyEvent ( &gEfiRestJsonStructureProtocolGuid, TPL_CALLBACK, - EfiRestJasonStructureProtocolIsReady, + EfiRestJsonStructureProtocolIsReady, NULL, &Registration ); -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112575): https://edk2.groups.io/g/devel/message/112575 Mute This Topic: https://groups.io/mt/103181639/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
It is possible that at the time of accessing to AsciiLocation pointer the memory is not allocated. Also gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) emits a warning for this case: RedfishFeatureUtilityLib.c:1889:37: error: 'AsciiLocation' may be used uninitialized in this function [-Werror=maybe-uninitialized] *Location = StrAsciiToUnicode (AsciiLocation); Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nickle Wang <nicklew@nvidia.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> --- .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c @@ -XXX,XX +XXX,XX @@ GetEtagAndLocation ( } if (Location != NULL) { - *Location = NULL; + *Location = NULL; + AsciiLocation = NULL; if (*(Response->StatusCode) == HTTP_STATUS_200_OK) { Header = HttpFindHeader (Response->HeaderCount, Response->Headers, HTTP_HEADER_LOCATION); -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112576): https://edk2.groups.io/g/devel/message/112576 Mute This Topic: https://groups.io/mt/103181640/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
If EdkIIRedfishResourceConfigCheck fails according to the logic and comment: new resources should be provisioned, so the POST method must be used. Fourth parameter of EdkIIRedfishResourceConfigProvisioning is BOOLEAN HttpPostMode, so we pass TRUE here. Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nickle Wang <nicklew@nvidia.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> --- RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c @@ -XXX,XX +XXX,XX @@ HandleResource ( // The target property does not exist, do the provision to create property. // DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri)); - Status = EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, Private->InformationExchange, FALSE); + Status = EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, Private->InformationExchange, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a, failed to provision with POST mode: %r\n", __func__, Status)); } return Status; -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112577): https://edk2.groups.io/g/devel/message/112577 Mute This Topic: https://groups.io/mt/103181641/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
This patch set contains minor fixes. diff from v1: original patch 4/4 with change related to BIOS resources provisioning removed. PR: https://github.com/tianocore/edk2-redfish-client/pull/64 Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Nickle Wang <nicklew@nvidia.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112657): https://edk2.groups.io/g/devel/message/112657 Mute This Topic: https://groups.io/mt/103255134/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Initially RedfishPlatformConfigGetConfigureLang could return success even if ConfigureLangList is empty. After fixing this condition, RedfishPlatformConfigGetConfigureLang returns an error, but this doesn't help to avoid ASSERT because the error path is the same as for non-empty list. Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com> --- .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c @@ -XXX,XX +XXX,XX @@ LeaveFunction: FreePool (ConfigureLangBuffer); } - FreePool (ConfigureLangList); + if (ConfigureLangList != NULL) { + FreePool (ConfigureLangList); + } *NumberOfValues = (UINT32)ListCount; return FirstEmptyPropKeyValueList; -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112658): https://edk2.groups.io/g/devel/message/112658 Mute This Topic: https://groups.io/mt/103255135/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com> --- RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -XXX,XX +XXX,XX @@ EDKII_REDFISH_CONFIG_HANDLER_PROTOCOL mRedfishConfigHandler = { **/ VOID EFIAPI -EfiRestJasonStructureProtocolIsReady ( +EfiRestJsonStructureProtocolIsReady ( IN EFI_EVENT Event, IN VOID *Context ) @@ -XXX,XX +XXX,XX @@ RedfishResourceEntryPoint ( EfiCreateProtocolNotifyEvent ( &gEfiRestJsonStructureProtocolGuid, TPL_CALLBACK, - EfiRestJasonStructureProtocolIsReady, + EfiRestJsonStructureProtocolIsReady, NULL, &Registration ); -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112659): https://edk2.groups.io/g/devel/message/112659 Mute This Topic: https://groups.io/mt/103255137/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
It is possible that at the time of accessing to AsciiLocation pointer the memory is not allocated. Also gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) emits a warning for this case: RedfishFeatureUtilityLib.c:1889:37: error: 'AsciiLocation' may be used uninitialized in this function [-Werror=maybe-uninitialized] *Location = StrAsciiToUnicode (AsciiLocation); Cc: Abner Chang <abner.chang@amd.com> Cc: Igor Kulchytskyy <igork@ami.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com> --- .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c @@ -XXX,XX +XXX,XX @@ GetEtagAndLocation ( } if (Location != NULL) { - *Location = NULL; + *Location = NULL; + AsciiLocation = NULL; if (*(Response->StatusCode) == HTTP_STATUS_200_OK) { Header = HttpFindHeader (Response->HeaderCount, Response->Headers, HTTP_HEADER_LOCATION); -- 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112660): https://edk2.groups.io/g/devel/message/112660 Mute This Topic: https://groups.io/mt/103255138/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-