diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2017-03-22 09:22:07 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2017-03-23 11:40:06 +0800 |
commit | 89648826ee0a68a24a71826e32787dc5c935b622 (patch) | |
tree | 45673717353ee984895f41333819c46964279a52 /NetworkPkg | |
parent | ba0252808b2d0a0362d6bcd9ddef6cd3d2e3bca3 (diff) | |
download | edk2-platforms-89648826ee0a68a24a71826e32787dc5c935b622.tar.xz |
NetworkPkg/IScsiDxe: Fix the incorrect error handling in DriverEntryPoint
Currently, error handling in IScsiDriverEntryPoint is incorrect. For
example, if IScsiCreateAttempts() return error due to the limited max
variable size, iSCSI will not unload the configuration entries.
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r-- | NetworkPkg/IScsiDxe/IScsiDriver.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c index 269c1aec5c..2249919e18 100644 --- a/NetworkPkg/IScsiDxe/IScsiDriver.c +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c @@ -1813,7 +1813,7 @@ IScsiDriverEntryPoint ( //
Status = IScsiCreateKeywords (PcdGet8 (PcdMaxIScsiAttemptNumber));
if (EFI_ERROR (Status)) {
- goto Error5;
+ goto Error6;
}
//
@@ -1840,13 +1840,16 @@ IScsiDriverEntryPoint ( return EFI_SUCCESS;
Error6:
- IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle);
+ IScsiCleanAttemptVariable ();
Error5:
- IScsiCleanAttemptVariable ();
+ IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle);
Error4:
- FreePool (mPrivate);
+ if (mPrivate != NULL) {
+ FreePool (mPrivate);
+ mPrivate = NULL;
+ }
Error3:
gBS->UninstallMultipleProtocolInterfaces (
|