From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.2688.1570866187085018288 for ; Sat, 12 Oct 2019 00:43:07 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: shenglei.zhang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2019 00:43:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,286,1566889200"; d="scan'208";a="198925953" Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 12 Oct 2019 00:43:05 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Siyuan Fu , Jiaxin Wu Subject: [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL Date: Sat, 12 Oct 2019 15:43:01 +0800 Message-Id: <20191012074302.11928-1-shenglei.zhang@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 If DpcEntry is NULL, it means it failed to be allocated space. ReturnStatus should be EFI_OUT_OF_RESOURCES regardless of the content of mDpcEntryFreeList. Cc: Siyuan Fu Cc: Jiaxin Wu Signed-off-by: Shenglei Zhang --- NetworkPkg/DpcDxe/Dpc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/NetworkPkg/DpcDxe/Dpc.c b/NetworkPkg/DpcDxe/Dpc.c index 8a490949dc8c..ebdb978b254a 100644 --- a/NetworkPkg/DpcDxe/Dpc.c +++ b/NetworkPkg/DpcDxe/Dpc.c @@ -137,14 +137,11 @@ DpcQueueDpc ( gBS->RaiseTPL (TPL_HIGH_LEVEL); // - // If the allocation of a DPC entry fails, and the free list is empty, - // then return EFI_OUT_OF_RESOURCES. + // If the allocation of a DPC entry fails, return EFI_OUT_OF_RESOURCES. // if (DpcEntry == NULL) { - if (IsListEmpty (&mDpcEntryFreeList)) { - ReturnStatus = EFI_OUT_OF_RESOURCES; - goto Done; - } + ReturnStatus = EFI_OUT_OF_RESOURCES; + goto Done; } // -- 2.18.0.windows.1