mirror of https://github.com/acidanthera/audk.git
RedfishDiscoverDxe: add a helper function deallocating string resources.
This patch adds a handy helper function deallocating resources from the EFI_REDFISH_DISCOVERED_INFORMATION structure instance. Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
This commit is contained in:
parent
d1c21f8d55
commit
f8de39afab
|
@ -712,6 +712,49 @@ DiscoverRedfishHostInterface (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
The function releases particular strings into the structure instance.
|
||||||
|
|
||||||
|
@param[in] Information EFI_REDFISH_DISCOVERED_INFORMATION
|
||||||
|
|
||||||
|
**/
|
||||||
|
STATIC
|
||||||
|
VOID
|
||||||
|
FreeInformationData (
|
||||||
|
IN EFI_REDFISH_DISCOVERED_INFORMATION *Information
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Information->Location != NULL) {
|
||||||
|
FreePool (Information->Location);
|
||||||
|
Information->Location = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Information->Uuid != NULL) {
|
||||||
|
FreePool (Information->Uuid);
|
||||||
|
Information->Uuid = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Information->Os != NULL) {
|
||||||
|
FreePool (Information->Os);
|
||||||
|
Information->Os = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Information->OsVersion != NULL) {
|
||||||
|
FreePool (Information->OsVersion);
|
||||||
|
Information->OsVersion = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Information->Product != NULL) {
|
||||||
|
FreePool (Information->Product);
|
||||||
|
Information->Product = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Information->ProductVer != NULL) {
|
||||||
|
FreePool (Information->ProductVer);
|
||||||
|
Information->ProductVer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The function initializes particular strings into the structure instance.
|
The function initializes particular strings into the structure instance.
|
||||||
|
|
||||||
|
@ -1514,30 +1557,7 @@ RedfishServiceReleaseService (
|
||||||
do {
|
do {
|
||||||
if (DiscoveredRedfishInstance->Instance == ThisRedfishInstance) {
|
if (DiscoveredRedfishInstance->Instance == ThisRedfishInstance) {
|
||||||
RemoveEntryList (&DiscoveredRedfishInstance->NextInstance);
|
RemoveEntryList (&DiscoveredRedfishInstance->NextInstance);
|
||||||
if (ThisRedfishInstance->Information.Location != NULL) {
|
FreeInformationData (&ThisRedfishInstance->Information);
|
||||||
FreePool (ThisRedfishInstance->Information.Location);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ThisRedfishInstance->Information.Uuid != NULL) {
|
|
||||||
FreePool (ThisRedfishInstance->Information.Uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ThisRedfishInstance->Information.Os != NULL) {
|
|
||||||
FreePool (ThisRedfishInstance->Information.Os);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ThisRedfishInstance->Information.OsVersion != NULL) {
|
|
||||||
FreePool (ThisRedfishInstance->Information.OsVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ThisRedfishInstance->Information.Product != NULL) {
|
|
||||||
FreePool (ThisRedfishInstance->Information.Product);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ThisRedfishInstance->Information.ProductVer != NULL) {
|
|
||||||
FreePool (ThisRedfishInstance->Information.ProductVer);
|
|
||||||
}
|
|
||||||
|
|
||||||
FreePool ((VOID *)ThisRedfishInstance);
|
FreePool ((VOID *)ThisRedfishInstance);
|
||||||
goto ReleaseNext;
|
goto ReleaseNext;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue