[AMD Official Use Only - General] Yes Nickle, I agree to have a common API for initializing the structure members.
Thanks Abner From: Nickle Wang <nick...@nvidia.com> Sent: Wednesday, August 30, 2023 9:48 AM To: Mike Maslenkin <mike.maslen...@gmail.com>; devel@edk2.groups.io; Chang, Abner <abner.ch...@amd.com> Cc: ig...@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 <nick...@nvidia.com<mailto:nick...@nvidia.com>> @abner.ch...@amd.com<mailto:abner.ch...@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.maslen...@gmail.com<mailto:mike.maslen...@gmail.com>> > Sent: Tuesday, August 29, 2023 4:01 PM > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > Cc: abner.ch...@amd.com<mailto:abner.ch...@amd.com>; Nickle Wang > <nick...@nvidia.com<mailto:nick...@nvidia.com>>; > ig...@ami.com<mailto:ig...@ami.com>; Mike Maslenkin > <mike.maslen...@gmail.com<mailto:mike.maslen...@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.maslen...@gmail.com<mailto:mike.maslen...@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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-