REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1447

This patch is to uninstall Ip4ServiceBindingProtocol and Ip4Config2Protocol when
error happen in Driver Binding Start.

Cc: Michael Turner <michael.tur...@microsoft.com>
Cc: Ye Ting <ting...@intel.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
Signed-off-by: Michael Turner <michael.tur...@microsoft.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
index 0f25581414..87ec968e7b 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
@@ -1,9 +1,9 @@
 /** @file
   The driver binding and service binding protocol for IP4 driver.
 
-Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -662,14 +662,17 @@ Ip4DriverBindingStart (
   mIp4Id = (UINT16)NET_RANDOM (NetRandomInitSeed ());
 
   return Status;
 
 UNINSTALL_PROTOCOL:
-  gBS->UninstallProtocolInterface (
+  gBS->UninstallMultipleProtocolInterfaces (
          ControllerHandle,
          &gEfiIp4ServiceBindingProtocolGuid,
-         &IpSb->ServiceBinding
+         &IpSb->ServiceBinding,
+         &gEfiIp4Config2ProtocolGuid,
+         Ip4Cfg2,
+         NULL
          );
 
 FREE_SERVICE:
   Ip4CleanService (IpSb);
   FreePool (IpSb);
-- 
2.17.1.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to