public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ashish Singhal <ashishsingha@nvidia.com>
To: <edk2-devel@lists.01.org>
Cc: Ashish Singhal <ashishsingha@nvidia.com>
Subject: [PATCH v2 2/4] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
Date: Fri, 4 Jan 2019 16:06:31 -0700	[thread overview]
Message-ID: <f7fac2b5ba2dac3702a315f8ecfc409c69dcf9c6.1546643002.git.ashishsingha@nvidia.com> (raw)
In-Reply-To: <cover.1546643002.git.ashishsingha@nvidia.com>

During cleanup in case of initialization failure, some driver
bindings are not installed. Using abstractions in UEFILib takes
care of it.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
---
 NetworkPkg/IScsiDxe/IScsiDriver.c | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c
index 91176e6..8747de7 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -1,6 +1,7 @@
 /** @file
   The entry point of IScsi driver.
 
+Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
 
@@ -1861,28 +1862,18 @@ Error3:
          );
 
 Error2:
-  gBS->UninstallMultipleProtocolInterfaces (
-         gIScsiIp6DriverBinding.DriverBindingHandle,
-         &gEfiDriverBindingProtocolGuid,
-         &gIScsiIp6DriverBinding,
-         &gEfiComponentName2ProtocolGuid,
-         &gIScsiComponentName2,
-         &gEfiComponentNameProtocolGuid,
-         &gIScsiComponentName,
-         NULL
-         );
+  EfiLibUninstallDriverBindingComponentName2 (
+    &gIScsiIp6DriverBinding,
+    &gIScsiComponentName,
+    &gIScsiComponentName2
+    );
 
 Error1:
-  gBS->UninstallMultipleProtocolInterfaces (
-         ImageHandle,
-         &gEfiDriverBindingProtocolGuid,
-         &gIScsiIp4DriverBinding,
-         &gEfiComponentName2ProtocolGuid,
-         &gIScsiComponentName2,
-         &gEfiComponentNameProtocolGuid,
-         &gIScsiComponentName,
-         NULL
-         );
+  EfiLibUninstallDriverBindingComponentName2 (
+    &gIScsiIp4DriverBinding,
+    &gIScsiComponentName,
+    &gIScsiComponentName2
+    );
 
   return Status;
 }
-- 
2.7.4



  parent reply	other threads:[~2019-01-04 23:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 23:06 [PATCH v2 0/4] Provide UEFILib functions for protocol uninstallation Ashish Singhal
2019-01-04 23:06 ` [PATCH v2 1/4] MdePkg/UefiLib: Abstract driver model " Ashish Singhal
2019-01-04 23:06 ` Ashish Singhal [this message]
2019-01-07  1:21   ` [PATCH v2 2/4] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols Fu, Siyuan
2019-01-04 23:06 ` [PATCH v2 3/4] MdePkg/UefiLib: Simplify protocol un/installation abstraction Ashish Singhal
2019-01-07  0:32   ` Gao, Liming
2019-01-07  3:00     ` Ashish Singhal
2019-01-04 23:06 ` [PATCH v2 4/4] NetworkPkg/IScsiDxe: Update UEFILib Usage Ashish Singhal
2019-01-07  1:21   ` Fu, Siyuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7fac2b5ba2dac3702a315f8ecfc409c69dcf9c6.1546643002.git.ashishsingha@nvidia.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox