[ovs-dev,13/14] datapath-windows: Cleanup Vport.c

Message ID 20180709134056.7060-14-aserdean@ovn.org
State Changes Requested
Headers show
Series
  • Cleanup datapath-windows
Related show

Commit Message

Alin Gabriel Serdean July 9, 2018, 1:40 p.m.
Do not assign an initial value to ` status`, it will be assigned
later on.

Also, check the result of `status` after `OvsCreateMsgFromVport`.

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

Patch

diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index 7cf2497e3..f93c72dc2 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -1448,7 +1448,7 @@  OvsRemoveTunnelVport(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
 NDIS_STATUS
 OvsAddConfiguredSwitchPorts(POVS_SWITCH_CONTEXT switchContext)
 {
-    NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+    NDIS_STATUS status;
     ULONG arrIndex;
     PNDIS_SWITCH_PORT_PARAMETERS portParam;
     PNDIS_SWITCH_PORT_ARRAY portArray = NULL;
@@ -1493,7 +1493,7 @@  cleanup:
 NDIS_STATUS
 OvsInitConfiguredSwitchNics(POVS_SWITCH_CONTEXT switchContext)
 {
-    NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+    NDIS_STATUS status;
     PNDIS_SWITCH_NIC_ARRAY nicArray = NULL;
     ULONG arrIndex;
     PNDIS_SWITCH_NIC_PARAMETERS nicParam;
@@ -2601,7 +2601,10 @@  OvsDeleteVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
     status = OvsCreateMsgFromVport(vport, msgIn, usrParamsCtx->outputBuffer,
                                    usrParamsCtx->outputLength,
                                    gOvsSwitchContext->dpNo);
-
+    if (status) {
+        nlError = NlMapStatusToNlErr(status);
+        goto Cleanup;
+    }
     *replyLen = msgOut->nlMsg.nlmsgLen;
 
     /*