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
This commit is contained in:
xdu2 2010-07-05 02:11:05 +00:00
parent 74df5026b2
commit b24633c74e
1 changed files with 9 additions and 12 deletions

View File

@ -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>
@ -54,6 +54,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.
//
@ -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: