/* Release formset list and all the forms that belong to this formset. */
EFI_STATUS ReleaseFormsetList(IN LIST_ENTRY *FormsetList)
/* Release formset list and all the forms that belong to this formset. */
EFI_STATUS ReleaseFormsetList(IN LIST_ENTRY *FormsetList)
{
  LIST_ENTRY                                *HiiFormsetLink;
  LIST_ENTRY                                *HiiFormsetNextLink;
  REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE  *HiiFormsetPrivate;
  if (FormsetList == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  if (IsListEmpty (FormsetList)) {
    return EFI_SUCCESS;
  }
  HiiFormsetLink = GetFirstNode (FormsetList);
  while (!IsNull (FormsetList, HiiFormsetLink)) {
    HiiFormsetNextLink = GetNextNode (FormsetList, HiiFormsetLink);
    HiiFormsetPrivate  = REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK (HiiFormsetLink);
    RemoveEntryList (&HiiFormsetPrivate->Link);
    ReleaseFormset (HiiFormsetPrivate);
    FreePool (HiiFormsetPrivate);
    HiiFormsetLink = HiiFormsetNextLink;
  }
  return EFI_SUCCESS;
}