[AMD Official Use Only - General] Yes Nickle, I agree to have a common API for initializing the structure members. Thanks Abner From: Nickle Wang Sent: Wednesday, August 30, 2023 9:48 AM To: Mike Maslenkin ; devel@edk2.groups.io; Chang, Abner 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 > @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 > > Sent: Tuesday, August 29, 2023 4:01 PM > To: devel@edk2.groups.io > Cc: abner.chang@amd.com; Nickle Wang >; > igork@ami.com; Mike Maslenkin > > 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 > > --- > 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] -=-=-=-=-=-=-=-=-=-=-=-