diff options
author | xdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-05 02:11:05 +0000 |
---|---|---|
committer | xdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-05 02:11:05 +0000 |
commit | b24633c74e55c0a6a9c1c84796f00c3552c66ee3 (patch) | |
tree | 9e355c786a329cea51800203f74bbbd3c1b78001 /MdeModulePkg/Universal | |
parent | 74df5026b22cd13ab09766a2ba49298b4c5f9ac0 (diff) | |
download | edk2-platforms-b24633c74e55c0a6a9c1c84796f00c3552c66ee3.tar.xz |
Initialize lists ArpService->PendingRequestTable/DeniedCacheTable/ResolvedCacheTable before firing timer ArpService->PeriodicTimer. This remove the race condition in ArpCreateService(): it is possible for the timer event to trigger before the lists are initialized which will results in a hang in ArpTimerHandler().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10629 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c index d01451b951..9709fc0a9c 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c @@ -1,7 +1,7 @@ /** @file
ARP driver functions.
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, 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<BR>
@@ -55,6 +55,14 @@ ArpCreateService ( ArpService->Signature = ARP_SERVICE_DATA_SIGNATURE;
//
+ // Init the lists.
+ //
+ InitializeListHead (&ArpService->ChildrenList);
+ InitializeListHead (&ArpService->PendingRequestTable);
+ InitializeListHead (&ArpService->DeniedCacheTable);
+ InitializeListHead (&ArpService->ResolvedCacheTable);
+
+ //
// Init the servicebinding protocol members.
//
ArpService->ServiceBinding.CreateChild = ArpServiceBindingCreateChild;
@@ -168,17 +176,6 @@ ArpCreateService ( TimerPeriodic,
ARP_PERIODIC_TIMER_INTERVAL
);
- if (EFI_ERROR (Status)) {
- goto ERROR_EXIT;
- }
-
- //
- // Init the lists.
- //
- InitializeListHead (&ArpService->ChildrenList);
- InitializeListHead (&ArpService->PendingRequestTable);
- InitializeListHead (&ArpService->DeniedCacheTable);
- InitializeListHead (&ArpService->ResolvedCacheTable);
ERROR_EXIT:
|