/** @file\r
UEFI Component Name(2) protocol implementation for Dhcp6 driver.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
@param Dhcp6[in] A pointer to the EFI_DHCP6_PROTOCOL.\r
\r
- \r
+\r
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.\r
@retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
UpdateName (\r
{\r
EFI_STATUS Status;\r
EFI_DHCP6_MODE_DATA Dhcp6ModeData;\r
- CHAR16 HandleName[64];\r
+ CHAR16 *HandleName;\r
\r
if (Dhcp6 == NULL) {\r
return EFI_INVALID_PARAMETER;\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
if (gDhcp6ControllerNameTable != NULL) {\r
FreeUnicodeStringTable (gDhcp6ControllerNameTable);\r
gDhcp6ControllerNameTable = NULL;\r
}\r
- \r
+\r
if (Dhcp6ModeData.Ia == NULL) {\r
- UnicodeSPrint (HandleName, sizeof (HandleName), L"DHCPv6 (No configured IA)");\r
+ HandleName = L"DHCPv6 (No configured IA)";\r
} else {\r
- StrCpy (HandleName, mDhcp6ControllerName[Dhcp6ModeData.Ia->State]);\r
+ if (Dhcp6ModeData.Ia->State > Dhcp6Rebinding) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+ HandleName = mDhcp6ControllerName[Dhcp6ModeData.Ia->State];\r
+ }\r
+\r
+ if (Dhcp6ModeData.Ia != NULL) {\r
+ FreePool (Dhcp6ModeData.Ia);\r
}\r
- \r
+ if (Dhcp6ModeData.ClientId != NULL) {\r
+ FreePool (Dhcp6ModeData.ClientId);\r
+ }\r
+\r
Status = AddUnicodeString2 (\r
"eng",\r
gDhcp6ComponentName.SupportedLanguages,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
return AddUnicodeString2 (\r
"en",\r
gDhcp6ComponentName2.SupportedLanguages,\r
if (ChildHandle == NULL) {\r
return EFI_UNSUPPORTED;\r
}\r
- \r
- // \r
- // Make sure this driver produced ChildHandle \r
- // \r
+\r
+ //\r
+ // Make sure this driver produced ChildHandle\r
+ //\r
Status = EfiTestChildHandle (\r
ControllerHandle,\r
- ChildHandle, \r
+ ChildHandle,\r
&gEfiUdp6ProtocolGuid\r
);\r
if (EFI_ERROR (Status)) {\r
Status = gBS->OpenProtocol (\r
ChildHandle,\r
&gEfiDhcp6ProtocolGuid,\r
- (VOID **)&Dhcp6, \r
+ (VOID **)&Dhcp6,\r
NULL,\r
NULL,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r