public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL
@ 2019-10-12  7:43 Zhang, Shenglei
  2019-10-12  7:43 ` [PATCH] NetworkPkg/DxeNetLib: Change the order of conditions in IF statement Zhang, Shenglei
  2019-10-12  7:58 ` [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL Siyuan, Fu
  0 siblings, 2 replies; 6+ messages in thread
From: Zhang, Shenglei @ 2019-10-12  7:43 UTC (permalink / raw)
  To: devel; +Cc: Siyuan Fu, Jiaxin Wu

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-14  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-12  7:43 [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL Zhang, Shenglei
2019-10-12  7:43 ` [PATCH] NetworkPkg/DxeNetLib: Change the order of conditions in IF statement Zhang, Shenglei
2019-10-14  2:21   ` Siyuan, Fu
2019-10-14  9:46   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-10-12  7:58 ` [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL Siyuan, Fu
2019-10-12  8:42   ` Zhang, Shenglei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox