From 5a066b87bda7a7891a05faf4b1d66136e8a5a7b8 Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Thu, 1 Dec 2016 14:57:38 +0800 Subject: [PATCH] MdeModulePkg: Fix assert in iSCSI. The bug is caused by using already freed memory. If there is already an attempt and execute 'reconnect -r' command, all the ConfigFormEntry structure will be freed in IScsiDriverBindingStop, but the mCallbackInfo->Current is not configured as null and this pointer will be used again in IScsiFormExtractConfig. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin Reviewed-by: Feng Tian Reviewed-by: Ye Ting --- MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 77ccd67178..ea727af1ff 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c @@ -1076,6 +1076,7 @@ IScsiConfigUpdateForm ( mNumberOfIScsiDevices--; RemoveEntryList (&ConfigFormEntry->Link); FreePool (ConfigFormEntry); + mCallbackInfo->Current = NULL; } // // Allocate space for creation of Buffer