From: qwang12 Date: Wed, 17 Sep 2008 02:20:24 +0000 (+0000) Subject: Remove the unnecessary spin_lock protection around CoreUnloadImage. There is almost... X-Git-Tag: edk2-stable201903~20317 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=46fee0d7b69f6f7ded0e8269670c34f5a96858da;p=mirror_edk2.git Remove the unnecessary spin_lock protection around CoreUnloadImage. There is almost zero possibility for this reentrancy issue here. With this change, we also keep EDK 2 and EDK core's CoreUnloadImage consistent with each other. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5906 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 4826a959f8..2185883109 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -17,8 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Module Globals // -SPIN_LOCK mUnloadImageLock; - LOADED_IMAGE_PRIVATE_DATA *mCurrentImage = NULL; LOAD_PE32_IMAGE_PRIVATE_DATA mLoadPe32PrivateData = { @@ -139,11 +137,6 @@ CoreInitializeImageServices ( mCurrentImage = Image; - // - // Initialize spin lock - // - InitializeSpinLock (&mUnloadImageLock); - // // Fill in DXE globals // @@ -1366,14 +1359,6 @@ CoreUnloadImage ( EFI_STATUS Status; LOADED_IMAGE_PRIVATE_DATA *Image; - // - // Prevent possible reentrance to this function - // for the same ImageHandle - // - if (!AcquireSpinLockOrFail (&mUnloadImageLock)) { - return EFI_UNSUPPORTED; - } - Image = CoreLoadedImageInfo (ImageHandle); if (Image == NULL ) { // @@ -1408,7 +1393,6 @@ CoreUnloadImage ( } Done: - ReleaseSpinLock (&mUnloadImageLock); return Status; }