* [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code
@ 2024-02-21 20:06 Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path Mike Maslenkin
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Mike Maslenkin @ 2024-02-21 20:06 UTC (permalink / raw)
To: devel; +Cc: Mike Maslenkin, Abner Chang, Nickle Wang, Igor Kulchytskyy
This set contains a trivial fix for a leak reviewed on Feb 1 [1] and a fix for а leak discussed in [2]
PR: https://github.com/tianocore/edk2-redfish-client/pull/76
[1] https://edk2.groups.io/g/devel/message/114925
[2] https://edk2.groups.io/g/devel/message/114765
v2:
in commit message put Cc back for the ones had given R-b
collected R-b
renamed CollectionUri to BiosUri
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115734): https://edk2.groups.io/g/devel/message/115734
Mute This Topic: https://groups.io/mt/104495953/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 9+ messages in thread
* [edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path
2024-02-21 20:06 [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code Mike Maslenkin
@ 2024-02-21 20:06 ` Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback Mike Maslenkin
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Mike Maslenkin @ 2024-02-21 20:06 UTC (permalink / raw)
To: devel; +Cc: Mike Maslenkin, Abner Chang, Igor Kulchytskyy, Nickle Wang
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>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
.../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
index e1494471038c..21ce8ddad9d5 100644
--- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
+++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
@@ -4010,6 +4010,7 @@ RedfishRemoveUnchangeableProperties (
(RedfishCS_uint32)AsciiStrSize (*JsonString)
);
if (Status != RedfishCS_status_success) {
+ FreePool (UpdatedJsonString);
return EFI_DEVICE_ERROR;
}
--
2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115735): https://edk2.groups.io/g/devel/message/115735
Mute This Topic: https://groups.io/mt/104495954/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback
2024-02-21 20:06 [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path Mike Maslenkin
@ 2024-02-21 20:06 ` Mike Maslenkin
2024-02-22 2:14 ` Nickle Wang via groups.io
[not found] ` <17B60D9667B989F2.14827@groups.io>
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 3/4] RedfishClientPkg/Bios: fix leak of GetPendingSettings URI Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 4/4] RedfishClientPkg: use Json value from a function argument Mike Maslenkin
3 siblings, 2 replies; 9+ messages in thread
From: Mike Maslenkin @ 2024-02-21 20:06 UTC (permalink / raw)
To: devel; +Cc: Mike Maslenkin, Nickle Wang, Abner Chang, Igor Kulchytskyy
Use local variable for BiosUri passed to HandleResource() to avoid
problems in case of Private->Uri is overriden down the call stack.
Suggested-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index f40f2d85af80..db77ed3dfccb 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
REDFISH_SERVICE RedfishService;
REDFISH_RESOURCE_COMMON_PRIVATE *Private;
EFI_STRING ResourceUri;
+ EFI_STRING BiosUri;
if (FeatureAction != CallbackActionStartOperation) {
return EFI_UNSUPPORTED;
@@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
//
// Initialize collection path
//
- Private->Uri = RedfishGetUri (ResourceUri);
- if (Private->Uri == NULL) {
+ BiosUri = RedfishGetUri (ResourceUri);
+ if (BiosUri == NULL) {
ASSERT (FALSE);
FreePool (ResourceUri);
return EFI_OUT_OF_RESOURCES;
}
- Status = HandleResource (Private, Private->Uri);
+ Status = HandleResource (Private, BiosUri);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n", __func__, Private->Uri, Status));
+ DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed: %r\n", __func__, BiosUri, Status));
}
- FreePool (Private->Uri);
+ FreePool (BiosUri);
FreePool (ResourceUri);
return Status;
}
--
2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115736): https://edk2.groups.io/g/devel/message/115736
Mute This Topic: https://groups.io/mt/104495956/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [edk2-devel] [edk2-redfish-client][PATCH v2 3/4] RedfishClientPkg/Bios: fix leak of GetPendingSettings URI.
2024-02-21 20:06 [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback Mike Maslenkin
@ 2024-02-21 20:06 ` Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 4/4] RedfishClientPkg: use Json value from a function argument Mike Maslenkin
3 siblings, 0 replies; 9+ messages in thread
From: Mike Maslenkin @ 2024-02-21 20:06 UTC (permalink / raw)
To: devel; +Cc: Mike Maslenkin, Abner Chang, Nickle Wang, Igor Kulchytskyy
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
.../Features/Bios/v1_0_9/Dxe/BiosDxe.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index db77ed3dfccb..a442d446bc35 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -132,12 +132,13 @@ RedfishResourceConsumeResource (
// Check and see if "@Redfish.Settings" exist or not.
//
ZeroMem (&PendingSettingResponse, sizeof (REDFISH_RESPONSE));
- Status = GetPendingSettings (
- Private->RedfishService,
- Response.Payload,
- &PendingSettingResponse,
- &PendingSettingUri
- );
+ PendingSettingUri = NULL;
+ Status = GetPendingSettings (
+ Private->RedfishService,
+ Response.Payload,
+ &PendingSettingResponse,
+ &PendingSettingUri
+ );
if (!EFI_ERROR (Status)) {
DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", __func__, PendingSettingUri));
Private->Uri = PendingSettingUri;
@@ -206,6 +207,10 @@ RedfishResourceConsumeResource (
FreePool (Etag);
}
+ if (PendingSettingUri != NULL) {
+ FreePool (PendingSettingUri);
+ }
+
return Status;
}
--
2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115737): https://edk2.groups.io/g/devel/message/115737
Mute This Topic: https://groups.io/mt/104495960/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [edk2-devel] [edk2-redfish-client][PATCH v2 4/4] RedfishClientPkg: use Json value from a function argument
2024-02-21 20:06 [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code Mike Maslenkin
` (2 preceding siblings ...)
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 3/4] RedfishClientPkg/Bios: fix leak of GetPendingSettings URI Mike Maslenkin
@ 2024-02-21 20:06 ` Mike Maslenkin
3 siblings, 0 replies; 9+ messages in thread
From: Mike Maslenkin @ 2024-02-21 20:06 UTC (permalink / raw)
To: devel; +Cc: Mike Maslenkin, Abner Chang, Nickle Wang, Igor Kulchytskyy
This patch replaces value Private->Json with Json used as second argument
for RedfishIdentifyResource(). Currently Json argument is not used at all
and the pattern for caller side is:
Status = RedfishIdentifyResourceCommon (Private, Private->Json);
So in scope of RedfishIdentifyResourceCommon Json actually is the same
value as Private->Json. Let's make code a bit cleaner.
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 +-
.../Features/BootOption/v1_0_4/Common/BootOptionCommon.c | 2 +-
.../ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c | 2 +-
.../ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c | 2 +-
RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index 0ae841499692..f3f993c8782e 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -729,7 +729,7 @@ RedfishIdentifyResourceCommon (
EFI_STRING EndOfChar;
REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList;
- Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+ Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);
if (EFI_ERROR (Status)) {
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
index 0b9f2bf28434..f471c01c3790 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
@@ -791,7 +791,7 @@ RedfishIdentifyResourceCommon (
{
BOOLEAN Supported;
- Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+ Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
return EFI_SUCCESS;
}
diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
index cee6c8bf9ba1..d69fc176ad94 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
@@ -848,7 +848,7 @@ RedfishIdentifyResourceCommon (
EFI_STRING EndOfChar;
REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList;
- Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+ Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);
if (EFI_ERROR (Status)) {
diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
index a67ef3dac283..11bcb5f76cab 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
@@ -1718,7 +1718,7 @@ RedfishIdentifyResourceCommon (
EFI_STRING EndOfChar;
REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList;
- Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+ Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);
if (EFI_ERROR (Status)) {
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
index eb52c68c5dcb..00a69f748c3c 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
@@ -2516,7 +2516,7 @@ RedfishIdentifyResourceCommon (
EFI_STRING EndOfChar;
REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST ConfigLangList;
- Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+ Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);
if (EFI_ERROR (Status)) {
--
2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115738): https://edk2.groups.io/g/devel/message/115738
Mute This Topic: https://groups.io/mt/104495961/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback Mike Maslenkin
@ 2024-02-22 2:14 ` Nickle Wang via groups.io
[not found] ` <17B60D9667B989F2.14827@groups.io>
1 sibling, 0 replies; 9+ messages in thread
From: Nickle Wang via groups.io @ 2024-02-22 2:14 UTC (permalink / raw)
To: Mike Maslenkin, devel@edk2.groups.io; +Cc: Abner Chang, Igor Kulchytskyy
Thanks for addressing my comment.
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Regards,
Nickle
> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Thursday, February 22, 2024 4:06 AM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin <mike.maslenkin@gmail.com>; Nickle Wang
> <nicklew@nvidia.com>; Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>
> Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> RedfishExternalResourceResourceFeatureCallback
>
> External email: Use caution opening links or attachments
>
>
> Use local variable for BiosUri passed to HandleResource() to avoid problems in
> case of Private->Uri is overriden down the call stack.
>
> Suggested-by: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
> RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index f40f2d85af80..db77ed3dfccb 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> REDFISH_SERVICE RedfishService;
>
> REDFISH_RESOURCE_COMMON_PRIVATE *Private;
>
> EFI_STRING ResourceUri;
>
> + EFI_STRING BiosUri;
>
>
>
> if (FeatureAction != CallbackActionStartOperation) {
>
> return EFI_UNSUPPORTED;
>
> @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> //
>
> // Initialize collection path
>
> //
>
> - Private->Uri = RedfishGetUri (ResourceUri);
>
> - if (Private->Uri == NULL) {
>
> + BiosUri = RedfishGetUri (ResourceUri);
>
> + if (BiosUri == NULL) {
>
> ASSERT (FALSE);
>
> FreePool (ResourceUri);
>
> return EFI_OUT_OF_RESOURCES;
>
> }
>
>
>
> - Status = HandleResource (Private, Private->Uri);
>
> + Status = HandleResource (Private, BiosUri);
>
> if (EFI_ERROR (Status)) {
>
> - DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> __func__, Private->Uri, Status));
>
> + DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> + %r\n", __func__, BiosUri, Status));
>
> }
>
>
>
> - FreePool (Private->Uri);
>
> + FreePool (BiosUri);
>
> FreePool (ResourceUri);
>
> return Status;
>
> }
>
> --
> 2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115771): https://edk2.groups.io/g/devel/message/115771
Mute This Topic: https://groups.io/mt/104495956/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback
[not found] ` <17B60D9667B989F2.14827@groups.io>
@ 2024-02-23 9:38 ` Nickle Wang via groups.io
2024-02-23 11:31 ` Mike Maslenkin
0 siblings, 1 reply; 9+ messages in thread
From: Nickle Wang via groups.io @ 2024-02-23 9:38 UTC (permalink / raw)
To: devel@edk2.groups.io, Nickle Wang, Mike Maslenkin
Cc: Abner Chang, Igor Kulchytskyy
[-- Attachment #1: Type: text/plain, Size: 4791 bytes --]
Hi @Mike Maslenkin<mailto:mike.maslenkin@gmail.com>,
Can you please help me to add my reviewed-by to this commit message? https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af Then I can merge this pull request.
Thanks,
Nickle
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nickle Wang
> via groups.io
> Sent: Thursday, February 22, 2024 10:14 AM
> To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io
> Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg:
> refine RedfishExternalResourceResourceFeatureCallback
>
> External email: Use caution opening links or attachments
>
>
> Thanks for addressing my comment.
>
>
> Reviewed-by: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>
>
> Regards,
> Nickle
>
> > -----Original Message-----
> > From: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>
> > Sent: Thursday, February 22, 2024 4:06 AM
> > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> > Cc: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>; Nickle Wang
> > <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>; Abner Chang <abner.chang@amd.com<mailto:abner.chang@amd.com>>; Igor
> > Kulchytskyy <igork@ami.com<mailto:igork@ami.com>>
> > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> > RedfishExternalResourceResourceFeatureCallback
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Use local variable for BiosUri passed to HandleResource() to avoid
> > problems in case of Private->Uri is overriden down the call stack.
> >
> > Suggested-by: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>
> > Cc: Abner Chang <abner.chang@amd.com<mailto:abner.chang@amd.com>>
> > Cc: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>
> > Cc: Igor Kulchytskyy <igork@ami.com<mailto:igork@ami.com>>
> > Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>
> > ---
> > RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > index f40f2d85af80..db77ed3dfccb 100644
> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> > REDFISH_SERVICE RedfishService;
> >
> > REDFISH_RESOURCE_COMMON_PRIVATE *Private;
> >
> > EFI_STRING ResourceUri;
> >
> > + EFI_STRING BiosUri;
> >
> >
> >
> > if (FeatureAction != CallbackActionStartOperation) {
> >
> > return EFI_UNSUPPORTED;
> >
> > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> > //
> >
> > // Initialize collection path
> >
> > //
> >
> > - Private->Uri = RedfishGetUri (ResourceUri);
> >
> > - if (Private->Uri == NULL) {
> >
> > + BiosUri = RedfishGetUri (ResourceUri);
> >
> > + if (BiosUri == NULL) {
> >
> > ASSERT (FALSE);
> >
> > FreePool (ResourceUri);
> >
> > return EFI_OUT_OF_RESOURCES;
> >
> > }
> >
> >
> >
> > - Status = HandleResource (Private, Private->Uri);
> >
> > + Status = HandleResource (Private, BiosUri);
> >
> > if (EFI_ERROR (Status)) {
> >
> > - DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> > __func__, Private->Uri, Status));
> >
> > + DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> > + %r\n", __func__, BiosUri, Status));
> >
> > }
> >
> >
> >
> > - FreePool (Private->Uri);
> >
> > + FreePool (BiosUri);
> >
> > FreePool (ResourceUri);
> >
> > return Status;
> >
> > }
> >
> > --
> > 2.32.0 (Apple Git-132)
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115877): https://edk2.groups.io/g/devel/message/115877
Mute This Topic: https://groups.io/mt/104495956/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 12998 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback
2024-02-23 9:38 ` Nickle Wang via groups.io
@ 2024-02-23 11:31 ` Mike Maslenkin
2024-02-23 13:34 ` Nickle Wang via groups.io
0 siblings, 1 reply; 9+ messages in thread
From: Mike Maslenkin @ 2024-02-23 11:31 UTC (permalink / raw)
To: Nickle Wang; +Cc: devel@edk2.groups.io, Abner Chang, Igor Kulchytskyy
[-- Attachment #1: Type: text/plain, Size: 5295 bytes --]
Hi Nickle,
I've updated commit message with your R-b and pushed it to PR.
Regards,
Mike.
> On 23. 2. 2024., at 12:38, Nickle Wang <nicklew@nvidia.com> wrote:
>
> Hi @Mike Maslenkin <mailto:mike.maslenkin@gmail.com>,
>
> Can you please help me to add my reviewed-by to this commit message? https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af <https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af> Then I can merge this pull request.
>
> Thanks,
> Nickle
>
> > -----Original Message-----
> > From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> <devel@edk2.groups.io <mailto:devel@edk2.groups.io>> On Behalf Of Nickle Wang
> > via groups.io <http://groups.io/>
> > Sent: Thursday, February 22, 2024 10:14 AM
> > To: Mike Maslenkin <mike.maslenkin@gmail.com <mailto:mike.maslenkin@gmail.com>>; devel@edk2.groups.io <mailto:devel@edk2.groups.io>
> > Cc: Abner Chang <abner.chang@amd.com <mailto:abner.chang@amd.com>>; Igor Kulchytskyy <igork@ami.com <mailto:igork@ami.com>>
> > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg:
> > refine RedfishExternalResourceResourceFeatureCallback
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Thanks for addressing my comment.
> >
> >
> > Reviewed-by: Nickle Wang <nicklew@nvidia.com <mailto:nicklew@nvidia.com>>
> >
> > Regards,
> > Nickle
> >
> > > -----Original Message-----
> > > From: Mike Maslenkin <mike.maslenkin@gmail.com <mailto:mike.maslenkin@gmail.com>>
> > > Sent: Thursday, February 22, 2024 4:06 AM
> > > To: devel@edk2.groups.io <mailto:devel@edk2.groups.io>
> > > Cc: Mike Maslenkin <mike.maslenkin@gmail.com <mailto:mike.maslenkin@gmail.com>>; Nickle Wang
> > > <nicklew@nvidia.com <mailto:nicklew@nvidia.com>>; Abner Chang <abner.chang@amd.com <mailto:abner.chang@amd.com>>; Igor
> > > Kulchytskyy <igork@ami.com <mailto:igork@ami.com>>
> > > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> > > RedfishExternalResourceResourceFeatureCallback
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > Use local variable for BiosUri passed to HandleResource() to avoid
> > > problems in case of Private->Uri is overriden down the call stack.
> > >
> > > Suggested-by: Nickle Wang <nicklew@nvidia.com <mailto:nicklew@nvidia.com>>
> > > Cc: Abner Chang <abner.chang@amd.com <mailto:abner.chang@amd.com>>
> > > Cc: Nickle Wang <nicklew@nvidia.com <mailto:nicklew@nvidia.com>>
> > > Cc: Igor Kulchytskyy <igork@ami.com <mailto:igork@ami.com>>
> > > Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com <mailto:mike.maslenkin@gmail.com>>
> > > ---
> > > RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++++++-----
> > > 1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > index f40f2d85af80..db77ed3dfccb 100644
> > > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> > > REDFISH_SERVICE RedfishService;
> > >
> > > REDFISH_RESOURCE_COMMON_PRIVATE *Private;
> > >
> > > EFI_STRING ResourceUri;
> > >
> > > + EFI_STRING BiosUri;
> > >
> > >
> > >
> > > if (FeatureAction != CallbackActionStartOperation) {
> > >
> > > return EFI_UNSUPPORTED;
> > >
> > > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> > > //
> > >
> > > // Initialize collection path
> > >
> > > //
> > >
> > > - Private->Uri = RedfishGetUri (ResourceUri);
> > >
> > > - if (Private->Uri == NULL) {
> > >
> > > + BiosUri = RedfishGetUri (ResourceUri);
> > >
> > > + if (BiosUri == NULL) {
> > >
> > > ASSERT (FALSE);
> > >
> > > FreePool (ResourceUri);
> > >
> > > return EFI_OUT_OF_RESOURCES;
> > >
> > > }
> > >
> > >
> > >
> > > - Status = HandleResource (Private, Private->Uri);
> > >
> > > + Status = HandleResource (Private, BiosUri);
> > >
> > > if (EFI_ERROR (Status)) {
> > >
> > > - DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> > > __func__, Private->Uri, Status));
> > >
> > > + DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> > > + %r\n", __func__, BiosUri, Status));
> > >
> > > }
> > >
> > >
> > >
> > > - FreePool (Private->Uri);
> > >
> > > + FreePool (BiosUri);
> > >
> > > FreePool (ResourceUri);
> > >
> > > return Status;
> > >
> > > }
> > >
> > > --
> > > 2.32.0 (Apple Git-132)
> >
> >
> >
> >
> >
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115882): https://edk2.groups.io/g/devel/message/115882
Mute This Topic: https://groups.io/mt/104495956/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 24000 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback
2024-02-23 11:31 ` Mike Maslenkin
@ 2024-02-23 13:34 ` Nickle Wang via groups.io
0 siblings, 0 replies; 9+ messages in thread
From: Nickle Wang via groups.io @ 2024-02-23 13:34 UTC (permalink / raw)
To: M M; +Cc: devel@edk2.groups.io, Abner Chang, Igor Kulchytskyy
[-- Attachment #1: Type: text/plain, Size: 5390 bytes --]
Thanks Mike! I merged the pull request.
Regards,
Nickle
From: M M <mike.maslenkin@gmail.com>
Sent: Friday, February 23, 2024 7:32 PM
To: Nickle Wang <nicklew@nvidia.com>
Cc: devel@edk2.groups.io; Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>
Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback
External email: Use caution opening links or attachments
Hi Nickle,
I've updated commit message with your R-b and pushed it to PR.
Regards,
Mike.
On 23. 2. 2024., at 12:38, Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>> wrote:
Hi @Mike Maslenkin<mailto:mike.maslenkin@gmail.com>,
Can you please help me to add my reviewed-by to this commit message? https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af Then I can merge this pull request.
Thanks,
Nickle
> -----Original Message-----
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Nickle Wang
> via groups.io<http://groups.io/>
> Sent: Thursday, February 22, 2024 10:14 AM
> To: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Abner Chang <abner.chang@amd.com<mailto:abner.chang@amd.com>>; Igor Kulchytskyy <igork@ami.com<mailto:igork@ami.com>>
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg:
> refine RedfishExternalResourceResourceFeatureCallback
>
> External email: Use caution opening links or attachments
>
>
> Thanks for addressing my comment.
>
>
> Reviewed-by: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>
>
> Regards,
> Nickle
>
> > -----Original Message-----
> > From: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>
> > Sent: Thursday, February 22, 2024 4:06 AM
> > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> > Cc: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>; Nickle Wang
> > <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>; Abner Chang <abner.chang@amd.com<mailto:abner.chang@amd.com>>; Igor
> > Kulchytskyy <igork@ami.com<mailto:igork@ami.com>>
> > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> > RedfishExternalResourceResourceFeatureCallback
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Use local variable for BiosUri passed to HandleResource() to avoid
> > problems in case of Private->Uri is overriden down the call stack.
> >
> > Suggested-by: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>
> > Cc: Abner Chang <abner.chang@amd.com<mailto:abner.chang@amd.com>>
> > Cc: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>
> > Cc: Igor Kulchytskyy <igork@ami.com<mailto:igork@ami.com>>
> > Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>
> > ---
> > RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > index f40f2d85af80..db77ed3dfccb 100644
> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> > REDFISH_SERVICE RedfishService;
> >
> > REDFISH_RESOURCE_COMMON_PRIVATE *Private;
> >
> > EFI_STRING ResourceUri;
> >
> > + EFI_STRING BiosUri;
> >
> >
> >
> > if (FeatureAction != CallbackActionStartOperation) {
> >
> > return EFI_UNSUPPORTED;
> >
> > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> > //
> >
> > // Initialize collection path
> >
> > //
> >
> > - Private->Uri = RedfishGetUri (ResourceUri);
> >
> > - if (Private->Uri == NULL) {
> >
> > + BiosUri = RedfishGetUri (ResourceUri);
> >
> > + if (BiosUri == NULL) {
> >
> > ASSERT (FALSE);
> >
> > FreePool (ResourceUri);
> >
> > return EFI_OUT_OF_RESOURCES;
> >
> > }
> >
> >
> >
> > - Status = HandleResource (Private, Private->Uri);
> >
> > + Status = HandleResource (Private, BiosUri);
> >
> > if (EFI_ERROR (Status)) {
> >
> > - DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> > __func__, Private->Uri, Status));
> >
> > + DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> > + %r\n", __func__, BiosUri, Status));
> >
> > }
> >
> >
> >
> > - FreePool (Private->Uri);
> >
> > + FreePool (BiosUri);
> >
> > FreePool (ResourceUri);
> >
> > return Status;
> >
> > }
> >
> > --
> > 2.32.0 (Apple Git-132)
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115884): https://edk2.groups.io/g/devel/message/115884
Mute This Topic: https://groups.io/mt/104495956/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 19755 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-02-23 13:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-21 20:06 [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback Mike Maslenkin
2024-02-22 2:14 ` Nickle Wang via groups.io
[not found] ` <17B60D9667B989F2.14827@groups.io>
2024-02-23 9:38 ` Nickle Wang via groups.io
2024-02-23 11:31 ` Mike Maslenkin
2024-02-23 13:34 ` Nickle Wang via groups.io
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 3/4] RedfishClientPkg/Bios: fix leak of GetPendingSettings URI Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 4/4] RedfishClientPkg: use Json value from a function argument Mike Maslenkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox