summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-21 03:28:56 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-21 03:28:56 +0000
commitf2a94e25589a2f79cd3e508960a5c29290aa58ea (patch)
tree5c4ae39ed6c0b2baf831f2525cd55dd908ea09af /MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
parente41b500030a9405f49e23ad72329a23a3c5fbdac (diff)
downloadedk2-f2a94e25589a2f79cd3e508960a5c29290aa58ea.zip
edk2-f2a94e25589a2f79cd3e508960a5c29290aa58ea.tar.gz
edk2-f2a94e25589a2f79cd3e508960a5c29290aa58ea.tar.bz2
[Description]
solve the x64 exception issue when unloading iSCSI driver [Impaction] add some handler for failure branch and prohibit the additional ISCSI INITIATOR NAME PROTOCOL from being installed. [Reference Info] this bug is reported by DELL. it causes an exception in x64 on unloading iscsi driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4941 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c')
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c51
1 files changed, 39 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index 8cc2a50..bc777e7 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation
+Copyright (c) 2004 - 2008, Intel Corporation
All rights reserved. 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
@@ -413,8 +413,21 @@ Returns:
--*/
{
- EFI_STATUS Status;
- //EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
+ EFI_STATUS Status;
+ EFI_ISCSI_INITIATOR_NAME_PROTOCOL *IScsiInitiatorName;
+
+ //
+ // There should be only one EFI_ISCSI_INITIATOR_NAME_PROTOCOL.
+ //
+ Status = gBS->LocateProtocol (
+ &gEfiIScsiInitiatorNameProtocolGuid,
+ NULL,
+ &IScsiInitiatorName
+ );
+
+ if (!EFI_ERROR (Status)) {
+ return EFI_ACCESS_DENIED;
+ }
//
// Initialize the EFI Driver Library
@@ -427,12 +440,11 @@ Returns:
&gIScsiComponentName,
&gIScsiComponentName2
);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
if (!EFI_ERROR (Status)) {
+ //
+ // Install the iSCSI Initiator Name Protocol.
+ //
Status = gBS->InstallProtocolInterface (
&ImageHandle,
&gEfiIScsiInitiatorNameProtocolGuid,
@@ -450,13 +462,28 @@ Returns:
&gIScsiComponentName,
NULL
);
+ return Status;
+ }
+
+ //
+ // Initialize the configuration form of iSCSI.
+ //
+ Status = IScsiConfigFormInit (gIScsiDriverBinding.DriverBindingHandle);
+ if (EFI_ERROR (Status)) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid,
+ &gIScsiDriverBinding,
+ &gEfiComponentName2ProtocolGuid,
+ &gIScsiComponentName2,
+ &gEfiComponentNameProtocolGuid,
+ &gIScsiComponentName,
+ &gEfiIScsiInitiatorNameProtocolGuid,
+ &gIScsiInitiatorName,
+ NULL
+ );
}
}
- //
- // Initialize the configuration form of iSCSI.
- //
- IScsiConfigFormInit (gIScsiDriverBinding.DriverBindingHandle);
-
return Status;
}