From b24633c74e55c0a6a9c1c84796f00c3552c66ee3 Mon Sep 17 00:00:00 2001 From: xdu2 Date: Mon, 5 Jul 2010 02:11:05 +0000 Subject: [PATCH] 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 --- .../Universal/Network/ArpDxe/ArpDriver.c | 21 ++++++++----------- 1 file 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.
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
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
@@ -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: -- 2.39.2