From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4A64B2194D3AE for ; Thu, 10 Jan 2019 17:02:28 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2019 17:02:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,463,1539673200"; d="scan'208";a="125020530" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 10 Jan 2019 17:02:26 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 10 Jan 2019 17:02:23 -0800 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.239]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.159]) with mapi id 14.03.0415.000; Fri, 11 Jan 2019 09:00:57 +0800 From: "Wu, Jiaxin" To: Ashish Singhal , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" Thread-Topic: [PATCH] NetworkPkg: Protocol Uninstallation Cleanup Thread-Index: AQHUqRqBCAjv/JJ+TUqK+RCYtKR4FqWpP8gg Date: Fri, 11 Jan 2019 01:00:57 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416EC3FF3@SHSMSX107.ccr.corp.intel.com> References: <2d3d928f7698138685701e6de58c083f65acafa4.1547148192.git.ashishsingha@nvidia.com> In-Reply-To: <2d3d928f7698138685701e6de58c083f65acafa4.1547148192.git.ashishsingha@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDNmZDAyMmMtZDdhYi00MDZlLTgzYzctNDVjOWMwZWJkZjhiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRlwvRkdwVzBVYUp2YWFXTDNzXC9GOFVBSkdnc0JoY0tyem15dXI4OFVNMWg4UmU0cGZmdlV6WkpjWDkxdjlFRFQ2In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] NetworkPkg: Protocol Uninstallation Cleanup X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2019 01:02:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -----Original Message----- > From: Ashish Singhal [mailto:ashishsingha@nvidia.com] > Sent: Friday, January 11, 2019 3:27 AM > To: edk2-devel@lists.01.org > Cc: Fu, Siyuan ; Wu, Jiaxin ; > Ashish Singhal > Subject: [PATCH] NetworkPkg: Protocol Uninstallation Cleanup >=20 > Use UEFILib provided protocol uninstallation abstraction > instead of direct API for a proper cleanup. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1444 >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ashish Singhal > --- > NetworkPkg/DnsDxe/DnsDriver.c | 30 ++++++++++-------------------= - > NetworkPkg/HttpBootDxe/HttpBootDxe.c | 15 +++++---------- > NetworkPkg/HttpDxe/HttpDriver.c | 15 +++++---------- > NetworkPkg/IpSecDxe/IpSecDriver.c | 15 +++++---------- > NetworkPkg/TcpDxe/TcpDriver.c | 15 +++++---------- > NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 15 +++++---------- > 6 files changed, 35 insertions(+), 70 deletions(-) >=20 > diff --git a/NetworkPkg/DnsDxe/DnsDriver.c > b/NetworkPkg/DnsDxe/DnsDriver.c > index 1f9b924..b74f5ba 100644 > --- a/NetworkPkg/DnsDxe/DnsDriver.c > +++ b/NetworkPkg/DnsDxe/DnsDriver.c > @@ -510,28 +510,18 @@ DnsDriverEntryPoint ( > FreePool (mDriverData); >=20 > Error2: > - gBS->UninstallMultipleProtocolInterfaces ( > - gDns6DriverBinding.DriverBindingHandle, > - &gEfiDriverBindingProtocolGuid, > - &gDns6DriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gDnsComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gDnsComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2 ( > + &gDns6DriverBinding, > + &gDnsComponentName, > + &gDnsComponentName2 > + ); >=20 > Error1: > - gBS->UninstallMultipleProtocolInterfaces ( > - ImageHandle, > - &gEfiDriverBindingProtocolGuid, > - &gDns4DriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gDnsComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gDnsComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2 ( > + &gDns4DriverBinding, > + &gDnsComponentName, > + &gDnsComponentName2 > + ); >=20 > return Status; > } > diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.c > b/NetworkPkg/HttpBootDxe/HttpBootDxe.c > index 7ec06f960..0b16f95 100644 > --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.c > +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.c > @@ -1327,16 +1327,11 @@ HttpBootDxeDriverEntryPoint ( > &gHttpBootDxeComponentName2 > ); > if (EFI_ERROR (Status)) { > - gBS->UninstallMultipleProtocolInterfaces( > - ImageHandle, > - &gEfiDriverBindingProtocolGuid, > - &gHttpBootIp4DxeDriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gHttpBootDxeComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gHttpBootDxeComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2( > + &gHttpBootIp4DxeDriverBinding, > + &gHttpBootDxeComponentName, > + &gHttpBootDxeComponentName2 > + ); > } > return Status; > } > diff --git a/NetworkPkg/HttpDxe/HttpDriver.c > b/NetworkPkg/HttpDxe/HttpDriver.c > index 8df984d..979d76d 100644 > --- a/NetworkPkg/HttpDxe/HttpDriver.c > +++ b/NetworkPkg/HttpDxe/HttpDriver.c > @@ -230,16 +230,11 @@ HttpDxeDriverEntryPoint ( > &gHttpDxeComponentName2 > ); > if (EFI_ERROR (Status)) { > - gBS->UninstallMultipleProtocolInterfaces ( > - ImageHandle, > - &gEfiDriverBindingProtocolGuid, > - &gHttpDxeIp4DriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gHttpDxeComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gHttpDxeComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2 ( > + &gHttpDxeIp4DriverBinding, > + &gHttpDxeComponentName, > + &gHttpDxeComponentName2 > + ); > } > return Status; > } > diff --git a/NetworkPkg/IpSecDxe/IpSecDriver.c > b/NetworkPkg/IpSecDxe/IpSecDriver.c > index f66f89a..3082d99 100644 > --- a/NetworkPkg/IpSecDxe/IpSecDriver.c > +++ b/NetworkPkg/IpSecDxe/IpSecDriver.c > @@ -631,16 +631,11 @@ IpSecDriverEntryPoint ( > return Status; >=20 > ON_UNINSTALL_IPSEC4_DB: > - gBS->UninstallMultipleProtocolInterfaces ( > - ImageHandle, > - &gEfiDriverBindingProtocolGuid, > - &gIpSec4DriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gIpSecComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gIpSecComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2 ( > + &gIpSec4DriverBinding, > + &gIpSecComponentName, > + &gIpSecComponentName2 > + ); >=20 > ON_UNINSTALL_IPSEC: > gBS->UninstallProtocolInterface ( > diff --git a/NetworkPkg/TcpDxe/TcpDriver.c > b/NetworkPkg/TcpDxe/TcpDriver.c > index 2d4b16c..00d172b 100644 > --- a/NetworkPkg/TcpDxe/TcpDriver.c > +++ b/NetworkPkg/TcpDxe/TcpDriver.c > @@ -202,16 +202,11 @@ TcpDriverEntryPoint ( > &gTcpComponentName2 > ); > if (EFI_ERROR (Status)) { > - gBS->UninstallMultipleProtocolInterfaces ( > - ImageHandle, > - &gEfiDriverBindingProtocolGuid, > - &gTcp4DriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gTcpComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gTcpComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2 ( > + &gTcp4DriverBinding, > + &gTcpComponentName, > + &gTcpComponentName2 > + ); > return Status; > } >=20 > diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c > b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c > index 0ab640b..f25c27a 100644 > --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c > +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c > @@ -1269,16 +1269,11 @@ PxeBcDriverEntryPoint ( > &gPxeBcComponentName2 > ); > if (EFI_ERROR (Status)) { > - gBS->UninstallMultipleProtocolInterfaces ( > - ImageHandle, > - &gEfiDriverBindingProtocolGuid, > - &gPxeBcIp4DriverBinding, > - &gEfiComponentName2ProtocolGuid, > - &gPxeBcComponentName2, > - &gEfiComponentNameProtocolGuid, > - &gPxeBcComponentName, > - NULL > - ); > + EfiLibUninstallDriverBindingComponentName2 ( > + &gPxeBcIp4DriverBinding, > + &gPxeBcComponentName, > + &gPxeBcComponentName2 > + ); > } >=20 > return Status; > -- > 2.7.4