Revision: 14119
http://edk2.svn.sourceforge.net/edk2/?rev=14119&view=rev
Author: vanjeff
Date: 2013-02-01 07:41:04 +0000 (Fri, 01 Feb 2013)
Log Message:
-----------
Sync patch r13781 from main trunk.
The Driver Binding Protocol Stop() function for the UndiRuntimeDxe is
performing actions in the incorrect order. The call to
UninstallMultipleProtocolInterfaces() removes all the protocols from the child
handle, which means ChildHandleBuffer[Index] is no longer valid. After the
call to UninstallMultipleProtocolInterfaces(), ChildHandleBuffer[Index] is used
again in a call to CloseProtocol(). The handle is not valid, so
CloseProtocol() returns an error and generates an ASSERT().
This patch changes the order to call CloseProtocol() before calling
UninstallMultipleProtocolInterfaces().
Revision Links:
--------------
http://edk2.svn.sourceforge.net/edk2/?rev=13781&view=rev
Modified Paths:
--------------
branches/UDK2010.SR1/OptionRomPkg/UndiRuntimeDxe/Init.c
Modified: branches/UDK2010.SR1/OptionRomPkg/UndiRuntimeDxe/Init.c
===================================================================
--- branches/UDK2010.SR1/OptionRomPkg/UndiRuntimeDxe/Init.c 2013-02-01
05:34:19 UTC (rev 14118)
+++ branches/UDK2010.SR1/OptionRomPkg/UndiRuntimeDxe/Init.c 2013-02-01
07:41:04 UTC (rev 14119)
@@ -1,7 +1,7 @@
/** @file
Initialization functions for EFI UNDI32 driver.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
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
@@ -616,38 +616,38 @@
UNDI32Device = UNDI_DEV_FROM_THIS (NIIProtocol);
- Status = gBS->UninstallMultipleProtocolInterfaces (
- ChildHandleBuffer[Index],
- &gEfiDevicePathProtocolGuid,
- UNDI32Device->Undi32DevPath,
- &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
- &UNDI32Device->NIIProtocol_31,
- NULL
+ Status = gBS->CloseProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ ChildHandleBuffer[Index]
);
if (!EFI_ERROR (Status)) {
- //
- // Restore original PCI attributes
- //
- Status = UNDI32Device->NicInfo.Io_Function->Attributes (
-
UNDI32Device->NicInfo.Io_Function,
-
EfiPciIoAttributeOperationSet,
-
UNDI32Device->NicInfo.OriginalPciAttributes,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->CloseProtocol (
- Controller,
- &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle,
- ChildHandleBuffer[Index]
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ChildHandleBuffer[Index],
+ &gEfiDevicePathProtocolGuid,
+ UNDI32Device->Undi32DevPath,
+ &gEfiNetworkInterfaceIdentifierProtocolGuid_31,
+ &UNDI32Device->NIIProtocol_31,
+ NULL
);
+ if (!EFI_ERROR (Status)) {
+ //
+ // Restore original PCI attributes
+ //
+ Status = UNDI32Device->NicInfo.Io_Function->Attributes (
+
UNDI32Device->NicInfo.Io_Function,
+
EfiPciIoAttributeOperationSet,
+
UNDI32Device->NicInfo.OriginalPciAttributes,
+ NULL
+ );
- ASSERT_EFI_ERROR (Status);
+ ASSERT_EFI_ERROR (Status);
- gBS->FreePool (UNDI32Device->Undi32DevPath);
- gBS->FreePool (UNDI32Device);
+ gBS->FreePool (UNDI32Device->Undi32DevPath);
+ gBS->FreePool (UNDI32Device);
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits