mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 14:44:28 +02:00
[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
This commit is contained in:
parent
e41b500030
commit
f2a94e2558
@ -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
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -22,7 +22,7 @@ Abstract:
|
|||||||
EFI_GUID mVendorGuid = ISCSI_CONFIG_GUID;
|
EFI_GUID mVendorGuid = ISCSI_CONFIG_GUID;
|
||||||
BOOLEAN mIScsiDeviceListUpdated = FALSE;
|
BOOLEAN mIScsiDeviceListUpdated = FALSE;
|
||||||
UINTN mNumberOfIScsiDevices = 0;
|
UINTN mNumberOfIScsiDevices = 0;
|
||||||
ISCSI_FORM_CALLBACK_INFO *mCallbackInfo;
|
ISCSI_FORM_CALLBACK_INFO *mCallbackInfo = NULL;
|
||||||
|
|
||||||
LIST_ENTRY mIScsiConfigFormList = {
|
LIST_ENTRY mIScsiConfigFormList = {
|
||||||
&mIScsiConfigFormList,
|
&mIScsiConfigFormList,
|
||||||
@ -933,6 +933,7 @@ Returns:
|
|||||||
|
|
||||||
Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **)&CallbackInfo->ConfigRouting);
|
Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **)&CallbackInfo->ConfigRouting);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
FreePool(CallbackInfo);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -941,6 +942,7 @@ Returns:
|
|||||||
//
|
//
|
||||||
Status = HiiLibCreateHiiDriverHandle (&CallbackInfo->DriverHandle);
|
Status = HiiLibCreateHiiDriverHandle (&CallbackInfo->DriverHandle);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
FreePool(CallbackInfo);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -967,8 +969,9 @@ Returns:
|
|||||||
CallbackInfo->DriverHandle,
|
CallbackInfo->DriverHandle,
|
||||||
&CallbackInfo->RegisteredHandle
|
&CallbackInfo->RegisteredHandle
|
||||||
);
|
);
|
||||||
gBS->FreePool (PackageList);
|
FreePool (PackageList);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
FreePool(CallbackInfo);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -414,7 +414,20 @@ Returns:
|
|||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
//EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
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
|
// Initialize the EFI Driver Library
|
||||||
@ -428,11 +441,10 @@ Returns:
|
|||||||
&gIScsiComponentName2
|
&gIScsiComponentName2
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Install the iSCSI Initiator Name Protocol.
|
||||||
|
//
|
||||||
Status = gBS->InstallProtocolInterface (
|
Status = gBS->InstallProtocolInterface (
|
||||||
&ImageHandle,
|
&ImageHandle,
|
||||||
&gEfiIScsiInitiatorNameProtocolGuid,
|
&gEfiIScsiInitiatorNameProtocolGuid,
|
||||||
@ -450,13 +462,28 @@ Returns:
|
|||||||
&gIScsiComponentName,
|
&gIScsiComponentName,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
}
|
return Status;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Initialize the configuration form of iSCSI.
|
//
|
||||||
//
|
// Initialize the configuration form of iSCSI.
|
||||||
IScsiConfigFormInit (gIScsiDriverBinding.DriverBindingHandle);
|
//
|
||||||
|
Status = IScsiConfigFormInit (gIScsiDriverBinding.DriverBindingHandle);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
gBS->UninstallMultipleProtocolInterfaces (
|
||||||
|
ImageHandle,
|
||||||
|
&gEfiDriverBindingProtocolGuid,
|
||||||
|
&gIScsiDriverBinding,
|
||||||
|
&gEfiComponentName2ProtocolGuid,
|
||||||
|
&gIScsiComponentName2,
|
||||||
|
&gEfiComponentNameProtocolGuid,
|
||||||
|
&gIScsiComponentName,
|
||||||
|
&gEfiIScsiInitiatorNameProtocolGuid,
|
||||||
|
&gIScsiInitiatorName,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user