]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/DnsDxe/DnsDriver.c
NetworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / NetworkPkg / DnsDxe / DnsDriver.c
index 1f9b924c0b375971760b98bcf3a34691b2f08240..94d072159a4dc09646a946542ba0e8948cab9ff9 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
 The driver binding and service binding protocol for DnsDxe driver.\r
 \r
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -376,36 +370,32 @@ DnsUnload (
 \r
     while (!IsListEmpty (&mDriverData->Dns4CacheList)) {\r
       Entry = NetListRemoveHead (&mDriverData->Dns4CacheList);\r
+      ASSERT (Entry != NULL);\r
       ItemCache4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);\r
-      if (ItemCache4->DnsCache.HostName != NULL) {\r
-        FreePool (ItemCache4->DnsCache.HostName);\r
-      }\r
-      if (ItemCache4->DnsCache.IpAddress != NULL) {\r
-        FreePool (ItemCache4->DnsCache.IpAddress);\r
-      }\r
+      FreePool (ItemCache4->DnsCache.HostName);\r
+      FreePool (ItemCache4->DnsCache.IpAddress);\r
       FreePool (ItemCache4);\r
     }\r
 \r
     while (!IsListEmpty (&mDriverData->Dns4ServerList)) {\r
       Entry = NetListRemoveHead (&mDriverData->Dns4ServerList);\r
+      ASSERT (Entry != NULL);\r
       ItemServerIp4 = NET_LIST_USER_STRUCT (Entry, DNS4_SERVER_IP, AllServerLink);\r
       FreePool (ItemServerIp4);\r
     }\r
 \r
     while (!IsListEmpty (&mDriverData->Dns6CacheList)) {\r
       Entry = NetListRemoveHead (&mDriverData->Dns6CacheList);\r
+      ASSERT (Entry != NULL);\r
       ItemCache6 = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);\r
-      if (ItemCache6->DnsCache.HostName != NULL) {\r
-        FreePool (ItemCache6->DnsCache.HostName);\r
-      }\r
-      if (ItemCache6->DnsCache.IpAddress != NULL) {\r
-        FreePool (ItemCache6->DnsCache.IpAddress);\r
-      }\r
+      FreePool (ItemCache6->DnsCache.HostName);\r
+      FreePool (ItemCache6->DnsCache.IpAddress);\r
       FreePool (ItemCache6);\r
     }\r
 \r
     while (!IsListEmpty (&mDriverData->Dns6ServerList)) {\r
       Entry = NetListRemoveHead (&mDriverData->Dns6ServerList);\r
+      ASSERT (Entry != NULL);\r
       ItemServerIp6 = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink);\r
       FreePool (ItemServerIp6);\r
     }\r
@@ -510,28 +500,18 @@ DnsDriverEntryPoint (
     FreePool (mDriverData);\r
 \r
   Error2:\r
-     gBS->UninstallMultipleProtocolInterfaces (\r
-           gDns6DriverBinding.DriverBindingHandle,\r
-           &gEfiDriverBindingProtocolGuid,\r
-           &gDns6DriverBinding,\r
-           &gEfiComponentName2ProtocolGuid,\r
-           &gDnsComponentName2,\r
-           &gEfiComponentNameProtocolGuid,\r
-           &gDnsComponentName,\r
-           NULL\r
-           );\r
+     EfiLibUninstallDriverBindingComponentName2 (\r
+       &gDns6DriverBinding,\r
+       &gDnsComponentName,\r
+       &gDnsComponentName2\r
+       );\r
 \r
   Error1:\r
-    gBS->UninstallMultipleProtocolInterfaces (\r
-           ImageHandle,\r
-           &gEfiDriverBindingProtocolGuid,\r
-           &gDns4DriverBinding,\r
-           &gEfiComponentName2ProtocolGuid,\r
-           &gDnsComponentName2,\r
-           &gEfiComponentNameProtocolGuid,\r
-           &gDnsComponentName,\r
-           NULL\r
-           );\r
+    EfiLibUninstallDriverBindingComponentName2 (\r
+      &gDns4DriverBinding,\r
+      &gDnsComponentName,\r
+      &gDnsComponentName2\r
+      );\r
 \r
   return Status;\r
 }\r