mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-08 22:34:24 +02:00
NetworkPkg: refine codes of iSCSI driver.
Add error handling logic in DriverBingingStop function, it may return error status when invoking the UninstallProtocolInterface. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
e3761c71d9
commit
e590d29f6e
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The entry point of IScsi driver.
|
The entry point of IScsi driver.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
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
|
||||||
@ -324,6 +324,8 @@ IScsiSupported (
|
|||||||
@retval EFI_NOT_FOUND There is no sufficient information to establish
|
@retval EFI_NOT_FOUND There is no sufficient information to establish
|
||||||
the iScsi session.
|
the iScsi session.
|
||||||
@retval EFI_DEVICE_ERROR Failed to get TCP connection device path.
|
@retval EFI_DEVICE_ERROR Failed to get TCP connection device path.
|
||||||
|
@retval EFI_ACCESS_DENIED The protocol could not be removed from the Handle
|
||||||
|
because its interfaces are being used.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -863,7 +865,10 @@ IScsiStart (
|
|||||||
IScsiSessionAbort (ExistPrivate->Session);
|
IScsiSessionAbort (ExistPrivate->Session);
|
||||||
}
|
}
|
||||||
|
|
||||||
IScsiCleanDriverData (ExistPrivate);
|
Status = IScsiCleanDriverData (ExistPrivate);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
goto ON_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
@ -963,6 +968,9 @@ ON_ERROR:
|
|||||||
|
|
||||||
@retval EFI_SUCCESS The device was stopped.
|
@retval EFI_SUCCESS The device was stopped.
|
||||||
@retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
|
@retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
|
||||||
|
@retval EFI_INVALID_PARAMETER Child handle is NULL.
|
||||||
|
@retval EFI_ACCESS_DENIED The protocol could not be removed from the Handle
|
||||||
|
because its interfaces are being used.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -1105,7 +1113,11 @@ IScsiStop (
|
|||||||
IScsiSessionAbort (Private->Session);
|
IScsiSessionAbort (Private->Session);
|
||||||
}
|
}
|
||||||
|
|
||||||
IScsiCleanDriverData (Private);
|
Status = IScsiCleanDriverData (Private);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Miscellaneous routines for iSCSI driver.
|
Miscellaneous routines for iSCSI driver.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
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
|
||||||
@ -859,8 +859,11 @@ IScsiCreateDriverData (
|
|||||||
|
|
||||||
@param[in] Private The iSCSI driver data.
|
@param[in] Private The iSCSI driver data.
|
||||||
|
|
||||||
|
@retval EFI_SUCCES The clean operation is successful.
|
||||||
|
@retval Others Other errors as indicated.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
EFI_STATUS
|
||||||
IScsiCleanDriverData (
|
IScsiCleanDriverData (
|
||||||
IN ISCSI_DRIVER_DATA *Private
|
IN ISCSI_DRIVER_DATA *Private
|
||||||
)
|
)
|
||||||
@ -868,11 +871,14 @@ IScsiCleanDriverData (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
if (Private->DevicePath != NULL) {
|
if (Private->DevicePath != NULL) {
|
||||||
gBS->UninstallProtocolInterface (
|
Status = gBS->UninstallProtocolInterface (
|
||||||
Private->ExtScsiPassThruHandle,
|
Private->ExtScsiPassThruHandle,
|
||||||
&gEfiDevicePathProtocolGuid,
|
&gEfiDevicePathProtocolGuid,
|
||||||
Private->DevicePath
|
Private->DevicePath
|
||||||
);
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
goto EXIT;
|
||||||
|
}
|
||||||
|
|
||||||
FreePool (Private->DevicePath);
|
FreePool (Private->DevicePath);
|
||||||
}
|
}
|
||||||
@ -888,9 +894,12 @@ IScsiCleanDriverData (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXIT:
|
||||||
|
|
||||||
gBS->CloseEvent (Private->ExitBootServiceEvent);
|
gBS->CloseEvent (Private->ExitBootServiceEvent);
|
||||||
|
|
||||||
FreePool (Private);
|
FreePool (Private);
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Miscellaneous definitions for iSCSI driver.
|
Miscellaneous definitions for iSCSI driver.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
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
|
||||||
@ -308,8 +308,11 @@ IScsiCreateDriverData (
|
|||||||
|
|
||||||
@param[in] Private The iSCSI driver data.
|
@param[in] Private The iSCSI driver data.
|
||||||
|
|
||||||
|
@retval EFI_SUCCES The clean operation is successful.
|
||||||
|
@retval Others Other errors as indicated.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
EFI_STATUS
|
||||||
IScsiCleanDriverData (
|
IScsiCleanDriverData (
|
||||||
IN ISCSI_DRIVER_DATA *Private
|
IN ISCSI_DRIVER_DATA *Private
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user