public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables.
@ 2023-08-29  8:01 Mike Maslenkin
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable Mike Maslenkin
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

This patchset contains fixes that resolve crashes while working with
uninitialized variables and a number of fixes for leaked memory.

Diff from v1:
 fixed uncrustify check fail for patch 3
 added patch 6.

Corresponding PR
https://github.com/tianocore/edk2-redfish-client/pull/46

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>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108078): https://edk2.groups.io/g/devel/message/108078
Mute This Topic: https://groups.io/mt/101027002/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.
  2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
@ 2023-08-29  8:01 ` Mike Maslenkin
  2023-08-30  1:47   ` Nickle Wang via groups.io
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable Mike Maslenkin
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index b9c799e07684..a1738de46fdf 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -97,6 +97,8 @@ RedfishConsumeResourceCommon (
   if (BiosCs->Attributes == NULL) {
     BiosCs->Attributes = AllocateZeroPool (sizeof (RedfishBios_V1_0_9_Attributes_CS));
     ASSERT (BiosCs->Attributes != NULL);
+    // initialize list
+    BiosCs->Attributes->Prop.ForwardLink = &BiosCs->Attributes->Prop;
   }
 
   //
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108079): https://edk2.groups.io/g/devel/message/108079
Mute This Topic: https://groups.io/mt/101027003/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] 15+ messages in thread

* [edk2-devel] [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable
  2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable Mike Maslenkin
@ 2023-08-29  8:01 ` Mike Maslenkin
  2023-08-30  1:48   ` Nickle Wang via groups.io
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data Mike Maslenkin
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

This patch fixes access to uninitialized variable, causing ASSERT from
FreePool at least.

Before this patch RedfishSettingsResponse was initialized by
GetResourceByUri under 'if (JsonValue != NULL)' condition.
But freed under 'if (Private->Payload != NULL)' condition.
Thus uninitialized pointers caused ASSERT on attempt to free memory.

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index e7ac8779581c..f5562fb49cab 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -128,6 +128,8 @@ RedfishResourceConsumeResource (
     return Status;
   }
 
+  ZeroMem (&RedfishSettingsResponse, sizeof (REDFISH_RESPONSE));
+
   ExpectedResponse   = &Response;
   RedfishSettingsUri = NULL;
   JsonValue          = RedfishJsonInPayload (Response.Payload);
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108080): https://edk2.groups.io/g/devel/message/108080
Mute This Topic: https://groups.io/mt/101027004/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] 15+ messages in thread

* [edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data
  2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable Mike Maslenkin
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable Mike Maslenkin
@ 2023-08-29  8:01 ` Mike Maslenkin
  2023-08-30  1:49   ` Nickle Wang via groups.io
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write Mike Maslenkin
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c           | 4 ++++
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c    | 4 ++++
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c       | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index f5562fb49cab..32dca964aa0a 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -220,6 +220,10 @@ RedfishResourceConsumeResource (
     Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+    FreePool (Etag);
+  }
+
   return Status;
 }
 
diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 91968dbe488f..5c2a4eadf2f4 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
     Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+    FreePool (Etag);
+  }
+
   return Status;
 }
 
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index c55a6848c74e..f34f3266f1ee 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
     Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+    FreePool (Etag);
+  }
+
   return Status;
 }
 
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108081): https://edk2.groups.io/g/devel/message/108081
Mute This Topic: https://groups.io/mt/101027005/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] 15+ messages in thread

* [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write.
  2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
                   ` (2 preceding siblings ...)
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data Mike Maslenkin
@ 2023-08-29  8:01 ` Mike Maslenkin
  2023-08-30  1:49   ` Nickle Wang via groups.io
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md Mike Maslenkin
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes Mike Maslenkin
  5 siblings, 1 reply; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 .../RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c       | 6 +++++-
 RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c            | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
index 86684cc72e1e..6a72afed8715 100644
--- a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
+++ b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
@@ -424,7 +424,11 @@ SaveConfigLangMapList (
     gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
   }
 
-  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+
+  FreePool (VarData);
+
+  return Status;
 }
 
 /**
diff --git a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
index 7ac6e885dea6..a892ced984c8 100644
--- a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
+++ b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
@@ -411,7 +411,11 @@ SaveETagList (
     gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
   }
 
-  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid, VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
+
+  FreePool (VarData);
+
+  return Status;
 }
 
 /**
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108082): https://edk2.groups.io/g/devel/message/108082
Mute This Topic: https://groups.io/mt/101027006/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] 15+ messages in thread

* [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md
  2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
                   ` (3 preceding siblings ...)
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write Mike Maslenkin
@ 2023-08-29  8:01 ` Mike Maslenkin
  2023-08-30  1:51   ` Nickle Wang via groups.io
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes Mike Maslenkin
  5 siblings, 1 reply; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Readme.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
index 18a27633cf45..0aec0580aa5c 100644
--- a/RedfishClientPkg/Readme.md
+++ b/RedfishClientPkg/Readme.md
@@ -40,7 +40,7 @@ Below are the block diagrams of UEFI Redfish Client EDK2 Implementation.
 ![UEFI Redfish Client Implementation](https://github.com/changab/edk2-staging/blob/edk2-redfish-client/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg?raw=true)
 
 ## EFI EDK2 Redfish Client Framework
-The functionality of each block in the diagrams are described in belwo sections,
+The functionality of each block in the diagrams are described in below sections,
 
 ### EDK2 Redfish Foundation ***[[1]](#[0])***
 EDK2 Redfish Redfish Foundation provides the facilities of communicating with
@@ -68,7 +68,7 @@ project.
 
 ### EDK2 Redfish JSON Schema to C Structure Convertor ***[[3]](#[0])***
 This is the script auto-generated EDK2 drivers and libraries that provide the
-Redfish schema naming based JSON to C structure and vise versa converters. C
+Redfish schema naming based JSON to C structure and vice versa converters. C
 structure is another representation of Redfish properties other than JSON and
 CSDL(XML). The higher layer Redfish client application can deal with C structure
 instead of using JSON library to manipulate Redfish properties. The script
@@ -85,7 +85,7 @@ sits between **JSON Schema to C Structure converters** and **EFI Platform
 Configuration to Redfish Protocol**. The Redfish feature driver gets and sets
 the platform configuration and incorporates it with Redfish JSON schema C
 structure to manipulate Redfish JSON resources. Then applies the settings from
-Redfish service to platform configurations, or vise versa to update platform
+Redfish service to platform configurations, or vice versa to update platform
 configurations to Redfish service. Both EDK2 Redfish Non-Collection and
 Collection Feature drivers are script auto-generated base on Redfish schema
 naming. The EDK2 Redfish Non-Collection feature driver manages the resource of
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108083): https://edk2.groups.io/g/devel/message/108083
Mute This Topic: https://groups.io/mt/101027007/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] 15+ messages in thread

* [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes
  2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
                   ` (4 preceding siblings ...)
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md Mike Maslenkin
@ 2023-08-29  8:01 ` Mike Maslenkin
  2023-08-30  1:52   ` Nickle Wang via groups.io
  2023-08-30 15:30   ` Igor Kulchytskyy via groups.io
  5 siblings, 2 replies; 15+ messages in thread
From: Mike Maslenkin @ 2023-08-29  8:01 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, nicklew, igork, Mike Maslenkin

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c   | 4 ++--
 .../ComputerSystemCollectionDxe.c                           | 6 +++---
 .../Features/MemoryCollectionDxe/MemoryCollectionDxe.c      | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index a1738de46fdf..a969557ddfdb 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -831,7 +831,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", __func__, Uri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", __func__, Uri, Status));
   }
 
   //
@@ -840,7 +840,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __func__, Uri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", __func__, Uri, Status));
   }
 
   return Status;
diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
index 8f2054e1e161..1e362d49cbb6 100644
--- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
@@ -109,7 +109,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", __func__, Uri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", __func__, Uri, Status));
   }
 
   //
@@ -118,7 +118,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __func__, Uri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", __func__, Uri, Status));
   }
 
   return Status;
@@ -228,7 +228,7 @@ CreateCollectionResource (
 
   Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private->CollectionUri, Private->InformationExchange, TRUE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n", __func__, Private->CollectionUri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", __func__, Private->CollectionUri, Status));
   }
 
   return Status;
diff --git a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
index b94ff2e86572..1b755cde0130 100644
--- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
+++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
@@ -109,7 +109,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", __func__, Uri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", __func__, Uri, Status));
   }
 
   //
@@ -118,7 +118,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __func__, Uri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", __func__, Uri, Status));
   }
 
   return Status;
@@ -228,7 +228,7 @@ CreateCollectionResource (
 
   Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private->CollectionUri, Private->InformationExchange, TRUE);
   if (EFI_ERROR (Status)) {
-    DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n", __func__, Private->CollectionUri, Status));
+    DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", __func__, Private->CollectionUri, Status));
   }
 
   return Status;
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108084): https://edk2.groups.io/g/devel/message/108084
Mute This Topic: https://groups.io/mt/101027009/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] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable Mike Maslenkin
@ 2023-08-30  1:47   ` Nickle Wang via groups.io
  2023-08-31  3:28     ` Chang, Abner via groups.io
  0 siblings, 1 reply; 15+ messages in thread
From: Nickle Wang via groups.io @ 2023-08-30  1:47 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io, abner.chang@amd.com; +Cc: igork@ami.com

[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]

Reviewed-by: Nickle Wang <nicklew@nvidia.com>



@abner.chang@amd.com<mailto:abner.chang@amd.com>, I am thinking that we may need to provide allocation function for CS structure so caller does not need to handle linked-list initialization like this one, or other stuff requies understanding to CS structure implementation.



Regards,

Nickle



> -----Original Message-----

> From: Mike Maslenkin <mike.maslenkin@gmail.com>

> Sent: Tuesday, August 29, 2023 4:01 PM

> To: devel@edk2.groups.io

> Cc: abner.chang@amd.com; Nickle Wang <nicklew@nvidia.com>;

> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com>

> Subject: [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list

> variable.

>

> External email: Use caution opening links or attachments

>

>

> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>

> ---

>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> index b9c799e07684..a1738de46fdf 100644

> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> @@ -97,6 +97,8 @@ RedfishConsumeResourceCommon (

>    if (BiosCs->Attributes == NULL) {

>

>      BiosCs->Attributes = AllocateZeroPool (sizeof

> (RedfishBios_V1_0_9_Attributes_CS));

>

>      ASSERT (BiosCs->Attributes != NULL);

>

> +    // initialize list

>

> +    BiosCs->Attributes->Prop.ForwardLink = &BiosCs->Attributes->Prop;

>

>    }

>

>

>

>    //

>

> --

> 2.32.0 (Apple Git-132)




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108105): https://edk2.groups.io/g/devel/message/108105
Mute This Topic: https://groups.io/mt/101027003/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: 6254 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable Mike Maslenkin
@ 2023-08-30  1:48   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 15+ messages in thread
From: Nickle Wang via groups.io @ 2023-08-30  1:48 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io; +Cc: abner.chang@amd.com, igork@ami.com

Thanks for fixing this issue, Mike.


Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.chang@amd.com; Nickle Wang <nicklew@nvidia.com>;
> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com>
> Subject: [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable
> 
> External email: Use caution opening links or attachments
> 
> 
> This patch fixes access to uninitialized variable, causing ASSERT from FreePool at
> least.
> 
> Before this patch RedfishSettingsResponse was initialized by GetResourceByUri
> under 'if (JsonValue != NULL)' condition.
> But freed under 'if (Private->Payload != NULL)' condition.
> Thus uninitialized pointers caused ASSERT on attempt to free memory.
> 
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index e7ac8779581c..f5562fb49cab 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -128,6 +128,8 @@ RedfishResourceConsumeResource (
>      return Status;
> 
>    }
> 
> 
> 
> +  ZeroMem (&RedfishSettingsResponse, sizeof (REDFISH_RESPONSE));
> 
> +
> 
>    ExpectedResponse   = &Response;
> 
>    RedfishSettingsUri = NULL;
> 
>    JsonValue          = RedfishJsonInPayload (Response.Payload);
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108106): https://edk2.groups.io/g/devel/message/108106
Mute This Topic: https://groups.io/mt/101027004/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data Mike Maslenkin
@ 2023-08-30  1:49   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 15+ messages in thread
From: Nickle Wang via groups.io @ 2023-08-30  1:49 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io; +Cc: abner.chang@amd.com, igork@ami.com



Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.chang@amd.com; Nickle Wang <nicklew@nvidia.com>;
> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com>
> Subject: [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c           | 4 ++++
>  .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c    | 4 ++++
>  RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c       | 4 ++++
>  3 files changed, 12 insertions(+)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index f5562fb49cab..32dca964aa0a 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -220,6 +220,10 @@ RedfishResourceConsumeResource (
>      Private->Json = NULL;
> 
>    }
> 
> 
> 
> +  if (Etag != NULL) {
> 
> +    FreePool (Etag);
> 
> +  }
> 
> +
> 
>    return Status;
> 
>  }
> 
> 
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> index 91968dbe488f..5c2a4eadf2f4 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.c
> @@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
>      Private->Json = NULL;
> 
>    }
> 
> 
> 
> +  if (Etag != NULL) {
> 
> +    FreePool (Etag);
> 
> +  }
> 
> +
> 
>    return Status;
> 
>  }
> 
> 
> 
> diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> index c55a6848c74e..f34f3266f1ee 100644
> --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> @@ -164,6 +164,10 @@ RedfishResourceConsumeResource (
>      Private->Json = NULL;
> 
>    }
> 
> 
> 
> +  if (Etag != NULL) {
> 
> +    FreePool (Etag);
> 
> +  }
> 
> +
> 
>    return Status;
> 
>  }
> 
> 
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108107): https://edk2.groups.io/g/devel/message/108107
Mute This Topic: https://groups.io/mt/101027005/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write.
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write Mike Maslenkin
@ 2023-08-30  1:49   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 15+ messages in thread
From: Nickle Wang via groups.io @ 2023-08-30  1:49 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io; +Cc: abner.chang@amd.com, igork@ami.com



Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.chang@amd.com; Nickle Wang <nicklew@nvidia.com>;
> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com>
> Subject: [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables
> write.
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  .../RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c       | 6 +++++-
>  RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c            | 6 +++++-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> index 86684cc72e1e..6a72afed8715 100644
> --- a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> +++ b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c
> @@ -424,7 +424,11 @@ SaveConfigLangMapList (
>      gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
> 
>    }
> 
> 
> 
> -  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +
> 
> +  FreePool (VarData);
> 
> +
> 
> +  return Status;
> 
>  }
> 
> 
> 
>  /**
> 
> diff --git a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> index 7ac6e885dea6..a892ced984c8 100644
> --- a/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> +++ b/RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.c
> @@ -411,7 +411,11 @@ SaveETagList (
>      gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, 0, NULL);
> 
>    }
> 
> 
> 
> -  return gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +  Status = gRT->SetVariable (VariableName, &gEfiRedfishClientVariableGuid,
> VARIABLE_ATTRIBUTE_NV_BS, VarSize, (VOID *)VarData);
> 
> +
> 
> +  FreePool (VarData);
> 
> +
> 
> +  return Status;
> 
>  }
> 
> 
> 
>  /**
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108108): https://edk2.groups.io/g/devel/message/108108
Mute This Topic: https://groups.io/mt/101027006/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md Mike Maslenkin
@ 2023-08-30  1:51   ` Nickle Wang via groups.io
  0 siblings, 0 replies; 15+ messages in thread
From: Nickle Wang via groups.io @ 2023-08-30  1:51 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io; +Cc: abner.chang@amd.com, igork@ami.com



Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.chang@amd.com; Nickle Wang <nicklew@nvidia.com>;
> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com>
> Subject: [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishClientPkg/Readme.md | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
> index 18a27633cf45..0aec0580aa5c 100644
> --- a/RedfishClientPkg/Readme.md
> +++ b/RedfishClientPkg/Readme.md
> @@ -40,7 +40,7 @@ Below are the block diagrams of UEFI Redfish Client EDK2
> Implementation.
>  ![UEFI Redfish Client
> Implementation](https://nam11.safelinks.protection.outlook.com/?url=https%3A
> %2F%2Fgithub.com%2Fchangab%2Fedk2-staging%2Fblob%2Fedk2-redfish-
> client%2FRedfishClientPkg%2FDocuments%2FMedia%2FRedfishClientDriverStack
> .svg%3Fraw%3Dtrue&data=05%7C01%7Cnicklew%40nvidia.com%7Ceee05325db
> a24945583f08dba8662453%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0
> %7C638288928897098811%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C
> &sdata=DlhlqaDQub6Cd9TD7M2sP9hchqAHAigsjy7Z%2FfohSXs%3D&reserved=0)
> 
> 
> 
>  ## EFI EDK2 Redfish Client Framework
> 
> -The functionality of each block in the diagrams are described in belwo sections,
> 
> +The functionality of each block in the diagrams are described in below sections,
> 
> 
> 
>  ### EDK2 Redfish Foundation ***[[1]](#[0])***
> 
>  EDK2 Redfish Redfish Foundation provides the facilities of communicating with
> 
> @@ -68,7 +68,7 @@ project.
> 
> 
>  ### EDK2 Redfish JSON Schema to C Structure Convertor ***[[3]](#[0])***
> 
>  This is the script auto-generated EDK2 drivers and libraries that provide the
> 
> -Redfish schema naming based JSON to C structure and vise versa converters. C
> 
> +Redfish schema naming based JSON to C structure and vice versa converters. C
> 
>  structure is another representation of Redfish properties other than JSON and
> 
>  CSDL(XML). The higher layer Redfish client application can deal with C structure
> 
>  instead of using JSON library to manipulate Redfish properties. The script
> 
> @@ -85,7 +85,7 @@ sits between **JSON Schema to C Structure converters**
> and **EFI Platform
>  Configuration to Redfish Protocol**. The Redfish feature driver gets and sets
> 
>  the platform configuration and incorporates it with Redfish JSON schema C
> 
>  structure to manipulate Redfish JSON resources. Then applies the settings from
> 
> -Redfish service to platform configurations, or vise versa to update platform
> 
> +Redfish service to platform configurations, or vice versa to update platform
> 
>  configurations to Redfish service. Both EDK2 Redfish Non-Collection and
> 
>  Collection Feature drivers are script auto-generated base on Redfish schema
> 
>  naming. The EDK2 Redfish Non-Collection feature driver manages the resource of
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108109): https://edk2.groups.io/g/devel/message/108109
Mute This Topic: https://groups.io/mt/101027007/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes Mike Maslenkin
@ 2023-08-30  1:52   ` Nickle Wang via groups.io
  2023-08-30 15:30   ` Igor Kulchytskyy via groups.io
  1 sibling, 0 replies; 15+ messages in thread
From: Nickle Wang via groups.io @ 2023-08-30  1:52 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io; +Cc: abner.chang@amd.com, igork@ami.com



Reviewed-by: Nickle Wang <nicklew@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Tuesday, August 29, 2023 4:01 PM
> To: devel@edk2.groups.io
> Cc: abner.chang@amd.com; Nickle Wang <nicklew@nvidia.com>;
> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com>
> Subject: [PATCH v2 6/6] RedfishClientPkg: spelling fixes
> 
> External email: Use caution opening links or attachments
> 
> 
> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c   | 4 ++--
>  .../ComputerSystemCollectionDxe.c                           | 6 +++---
>  .../Features/MemoryCollectionDxe/MemoryCollectionDxe.c      | 6 +++---
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> index a1738de46fdf..a969557ddfdb 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> @@ -831,7 +831,7 @@ HandleResource (
>    DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
> 
>    Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>    }
> 
> 
> 
>    //
> 
> @@ -840,7 +840,7 @@ HandleResource (
>    DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> 
>    Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>    }
> 
> 
> 
>    return Status;
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> index 8f2054e1e161..1e362d49cbb6 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> +++
> b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCo
> llectionDxe.c
> @@ -109,7 +109,7 @@ HandleResource (
>    DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
> 
>    Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>    }
> 
> 
> 
>    //
> 
> @@ -118,7 +118,7 @@ HandleResource (
>    DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> 
>    Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>    }
> 
> 
> 
>    return Status;
> 
> @@ -228,7 +228,7 @@ CreateCollectionResource (
> 
> 
>    Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private-
> >CollectionUri, Private->InformationExchange, TRUE);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n",
> __func__, Private->CollectionUri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n",
> __func__, Private->CollectionUri, Status));
> 
>    }
> 
> 
> 
>    return Status;
> 
> diff --git
> a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> index b94ff2e86572..1b755cde0130 100644
> --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> +++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
> @@ -109,7 +109,7 @@ HandleResource (
>    DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));
> 
>    Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>    }
> 
> 
> 
>    //
> 
> @@ -118,7 +118,7 @@ HandleResource (
>    DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));
> 
>    Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n",
> __func__, Uri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n",
> __func__, Uri, Status));
> 
>    }
> 
> 
> 
>    return Status;
> 
> @@ -228,7 +228,7 @@ CreateCollectionResource (
> 
> 
>    Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private-
> >CollectionUri, Private->InformationExchange, TRUE);
> 
>    if (EFI_ERROR (Status)) {
> 
> -    DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n",
> __func__, Private->CollectionUri, Status));
> 
> +    DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n",
> __func__, Private->CollectionUri, Status));
> 
>    }
> 
> 
> 
>    return Status;
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108110): https://edk2.groups.io/g/devel/message/108110
Mute This Topic: https://groups.io/mt/101027009/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes
  2023-08-29  8:01 ` [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes Mike Maslenkin
  2023-08-30  1:52   ` Nickle Wang via groups.io
@ 2023-08-30 15:30   ` Igor Kulchytskyy via groups.io
  1 sibling, 0 replies; 15+ messages in thread
From: Igor Kulchytskyy via groups.io @ 2023-08-30 15:30 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io
  Cc: abner.chang@amd.com, nicklew@nvidia.com

Reviewed-by: Igor Kulchytskyy <igork@ami.com>
Reviewed the whole patch V2
Regards,
Igor Kulchytskyy
-----Original Message-----
From: Mike Maslenkin <mike.maslenkin@gmail.com>
Sent: Tuesday, August 29, 2023 4:01 AM
To: devel@edk2.groups.io
Cc: abner.chang@amd.com; nicklew@nvidia.com; Igor Kulchytskyy <igork@ami.com>; Mike Maslenkin <mike.maslenkin@gmail.com>
Subject: [EXTERNAL] [PATCH v2 6/6] RedfishClientPkg: spelling fixes


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c   | 4 ++--
 .../ComputerSystemCollectionDxe.c                           | 6 +++---
 .../Features/MemoryCollectionDxe/MemoryCollectionDxe.c      | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index a1738de46fdf..a969557ddfdb 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -831,7 +831,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));

   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", __func__, Uri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", __func__, Uri, Status));

   }



   //

@@ -840,7 +840,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));

   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __func__, Uri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", __func__, Uri, Status));

   }



   return Status;

diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
index 8f2054e1e161..1e362d49cbb6 100644
--- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
@@ -109,7 +109,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));

   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", __func__, Uri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", __func__, Uri, Status));

   }



   //

@@ -118,7 +118,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));

   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __func__, Uri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", __func__, Uri, Status));

   }



   return Status;

@@ -228,7 +228,7 @@ CreateCollectionResource (


   Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private->CollectionUri, Private->InformationExchange, TRUE);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n", __func__, Private->CollectionUri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", __func__, Private->CollectionUri, Status));

   }



   return Status;

diff --git a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
index b94ff2e86572..1b755cde0130 100644
--- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
+++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c
@@ -109,7 +109,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a consume for %s\n", __func__, Uri));

   Status = EdkIIRedfishResourceConfigConsume (&SchemaInfo, Uri);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to consume resoruce for: %s: %r\n", __func__, Uri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to consume resource for: %s: %r\n", __func__, Uri, Status));

   }



   //

@@ -118,7 +118,7 @@ HandleResource (
   DEBUG ((REDFISH_DEBUG_TRACE, "%a update for %s\n", __func__, Uri));

   Status = EdkIIRedfishResourceConfigUpdate (&SchemaInfo, Uri);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to update resoruce for: %s: %r\n", __func__, Uri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to update resource for: %s: %r\n", __func__, Uri, Status));

   }



   return Status;

@@ -228,7 +228,7 @@ CreateCollectionResource (


   Status = EdkIIRedfishResourceConfigProvisionging (&SchemaInfo, Private->CollectionUri, Private->InformationExchange, TRUE);

   if (EFI_ERROR (Status)) {

-    DEBUG ((DEBUG_ERROR, "%a, failed to create resoruce for: %s: %r\n", __func__, Private->CollectionUri, Status));

+    DEBUG ((DEBUG_ERROR, "%a, failed to create resource for: %s: %r\n", __func__, Private->CollectionUri, Status));

   }



   return Status;

--
2.32.0 (Apple Git-132)

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108148): https://edk2.groups.io/g/devel/message/108148
Mute This Topic: https://groups.io/mt/101027009/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] 15+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.
  2023-08-30  1:47   ` Nickle Wang via groups.io
@ 2023-08-31  3:28     ` Chang, Abner via groups.io
  0 siblings, 0 replies; 15+ messages in thread
From: Chang, Abner via groups.io @ 2023-08-31  3:28 UTC (permalink / raw)
  To: Nickle Wang, Mike Maslenkin, devel@edk2.groups.io; +Cc: igork@ami.com

[-- Attachment #1: Type: text/plain, Size: 2964 bytes --]

[AMD Official Use Only - General]

Yes Nickle,
I agree to have a common API for initializing the structure members.

Thanks
Abner

From: Nickle Wang <nicklew@nvidia.com>
Sent: Wednesday, August 30, 2023 9:48 AM
To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>
Cc: igork@ami.com
Subject: RE: [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


Reviewed-by: Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>



@abner.chang@amd.com<mailto:abner.chang@amd.com>, I am thinking that we may need to provide allocation function for CS structure so caller does not need to handle linked-list initialization like this one, or other stuff requies understanding to CS structure implementation.



Regards,

Nickle



> -----Original Message-----

> From: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>

> Sent: Tuesday, August 29, 2023 4:01 PM

> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>

> Cc: abner.chang@amd.com<mailto:abner.chang@amd.com>; Nickle Wang <nicklew@nvidia.com<mailto:nicklew@nvidia.com>>;

> igork@ami.com<mailto:igork@ami.com>; Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>

> Subject: [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list

> variable.

>

> External email: Use caution opening links or attachments

>

>

> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com<mailto:mike.maslenkin@gmail.com>>

> ---

>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> index b9c799e07684..a1738de46fdf 100644

> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> @@ -97,6 +97,8 @@ RedfishConsumeResourceCommon (

>    if (BiosCs->Attributes == NULL) {

>

>      BiosCs->Attributes = AllocateZeroPool (sizeof

> (RedfishBios_V1_0_9_Attributes_CS));

>

>      ASSERT (BiosCs->Attributes != NULL);

>

> +    // initialize list

>

> +    BiosCs->Attributes->Prop.ForwardLink = &BiosCs->Attributes->Prop;

>

>    }

>

>

>

>    //

>

> --

> 2.32.0 (Apple Git-132)




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108183): https://edk2.groups.io/g/devel/message/108183
Mute This Topic: https://groups.io/mt/101027003/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: 9365 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-08-31  3:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29  8:01 [edk2-devel] [PATCH v2 0/6] RedfishClientPkg: fix issues with local variables Mike Maslenkin
2023-08-29  8:01 ` [edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable Mike Maslenkin
2023-08-30  1:47   ` Nickle Wang via groups.io
2023-08-31  3:28     ` Chang, Abner via groups.io
2023-08-29  8:01 ` [edk2-devel] [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable Mike Maslenkin
2023-08-30  1:48   ` Nickle Wang via groups.io
2023-08-29  8:01 ` [edk2-devel] [PATCH v2 3/6] RedfishClientPkg: fix leak of allocated Etag data Mike Maslenkin
2023-08-30  1:49   ` Nickle Wang via groups.io
2023-08-29  8:01 ` [edk2-devel] [PATCH v2 4/6] RedfishClientPkg: fix memory leak during EFI variables write Mike Maslenkin
2023-08-30  1:49   ` Nickle Wang via groups.io
2023-08-29  8:01 ` [edk2-devel] [PATCH v2 5/6] RedfishClientPkg: fix misprints in Readme.md Mike Maslenkin
2023-08-30  1:51   ` Nickle Wang via groups.io
2023-08-29  8:01 ` [edk2-devel] [PATCH v2 6/6] RedfishClientPkg: spelling fixes Mike Maslenkin
2023-08-30  1:52   ` Nickle Wang via groups.io
2023-08-30 15:30   ` Igor Kulchytskyy via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox