[ovs-dev] [PATCH 10/14] datapath-windows: Cleanup PacketIO.c

Alin Gabriel Serdean aserdean at ovn.org
Mon Jul 9 13:40:52 UTC 2018


Assign variables directly instead of reassigning them after.

Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
---
 datapath-windows/ovsext/PacketIO.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/ovsext/PacketIO.c b/datapath-windows/ovsext/PacketIO.c
index 38e3e5f36..ecbdd591d 100644
--- a/datapath-windows/ovsext/PacketIO.c
+++ b/datapath-windows/ovsext/PacketIO.c
@@ -185,12 +185,12 @@ OvsAppendNativeForwardedPacket(POVS_SWITCH_CONTEXT switchContext,
                                ULONG flags,
                                BOOLEAN isRecv)
 {
-    POVS_BUFFER_CONTEXT ctx = { 0 };
+    POVS_BUFFER_CONTEXT ctx = OvsInitExternalNBLContext(switchContext,
+                                                        curNbl, isRecv);
     NDIS_STRING filterReason;
 
     *nativeNbls = curNbl;
 
-    ctx = OvsInitExternalNBLContext(switchContext, curNbl, isRecv);
     if (ctx == NULL) {
         RtlInitUnicodeString(&filterReason,
                              L"Cannot allocate native NBL context.");
@@ -238,7 +238,7 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext,
         OvsFlowKey key = { 0 };
         UINT64 hash = 0;
         PNET_BUFFER curNb = NULL;
-        POVS_BUFFER_CONTEXT ctx = NULL;
+        POVS_BUFFER_CONTEXT ctx;
 
         nextNbl = curNbl->Next;
         curNbl->Next = NULL;
-- 
2.16.1.windows.1



More information about the dev mailing list