[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>
@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>
> ---
> 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)