[AMD Official Use Only - General] Hi Nickle, I have no problem with either one, maybe BiosUri is a better choice.
Thanks Abner From: Nickle Wang <[email protected]> Sent: Wednesday, February 21, 2024 3:30 PM To: Mike Maslenkin <[email protected]>; [email protected]; Chang, Abner <[email protected]> Cc: Igor Kulchytskyy <[email protected]> Subject: RE: [PATCH 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. Hi Mike, Thanks for incorporating my suggestion to address memory issue. For the name "CollectionUri", I know this is from my suggestion, but I think Abner is right. Could you please change it to "BiosUri" or "ResourceUri" since BIOS resource is not a Redfish collection? @Abner Chang<mailto:[email protected]> please comment here if you have other naming preference. Thanks, Nickle > -----Original Message----- > From: Mike Maslenkin > <[email protected]<mailto:[email protected]>> > Sent: Wednesday, February 21, 2024 8:13 AM > To: [email protected]<mailto:[email protected]> > Cc: Mike Maslenkin > <[email protected]<mailto:[email protected]>>; Nickle Wang > <[email protected]<mailto:[email protected]>>; Abner Chang > <[email protected]<mailto:[email protected]>>; Igor Kulchytskyy > <[email protected]<mailto:[email protected]>> > Subject: [PATCH 2/4] RedfishClientPkg: refine > RedfishExternalResourceResourceFeatureCallback > > External email: Use caution opening links or attachments > > > Use local variable for CollectionUri passed to HandleResource() to avoid > problems > in case of Private->Uri is overriden down the call stack. > > Suggested-by: Nickle Wang <[email protected]<mailto:[email protected]>> > Cc: Abner Chang <[email protected]<mailto:[email protected]>> > Cc: Nickle Wang <[email protected]<mailto:[email protected]>> > Cc: Igor Kulchytskyy <[email protected]<mailto:[email protected]>> > Signed-off-by: Mike Maslenkin > <[email protected]<mailto:[email protected]>> > --- > 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..396ec22969b5 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 CollectionUri; > > > > if (FeatureAction != CallbackActionStartOperation) { > > return EFI_UNSUPPORTED; > > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback ( > // > > // Initialize collection path > > // > > - Private->Uri = RedfishGetUri (ResourceUri); > > - if (Private->Uri == NULL) { > > + CollectionUri = RedfishGetUri (ResourceUri); > > + if (CollectionUri == NULL) { > > ASSERT (FALSE); > > FreePool (ResourceUri); > > return EFI_OUT_OF_RESOURCES; > > } > > > > - Status = HandleResource (Private, Private->Uri); > > + Status = HandleResource (Private, CollectionUri); > > 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__, CollectionUri, Status)); > > } > > > > - FreePool (Private->Uri); > > + FreePool (CollectionUri); > > FreePool (ResourceUri); > > return Status; > > } > > -- > 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115729): https://edk2.groups.io/g/devel/message/115729 Mute This Topic: https://groups.io/mt/104479572/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
