[edk2-devel] [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL

Zhang, Shenglei shenglei.zhang at intel.com
Sat Oct 12 07:43:01 UTC 2019


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 <siyuan.fu at intel.com>
Cc: Jiaxin Wu <jiaxin.wu at intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang at intel.com>
---
 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48862): https://edk2.groups.io/g/devel/message/48862
Mute This Topic: https://groups.io/mt/34508854/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list