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

Message ID 20180709134056.7060-11-aserdean@ovn.org
State New
Headers show
Series
  • Cleanup datapath-windows
Related show

Commit Message

Alin Gabriel Serdean July 9, 2018, 1:40 p.m.
Assign variables directly instead of reassigning them after.

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

Patch

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;