[ovs-dev] [PATCH v3] datapath-windows: cleanup after NdisRegisterDeviceEx()

Nithin Raju nithin at vmware.com
Tue Apr 12 17:12:26 UTC 2016


The error handling code seems to be wrong.

Signed-off-by: Nithin Raju <nithin at vmware.com>
---
 datapath-windows/ovsext/Datapath.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index 8c0c246..0a25af0 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -459,17 +459,11 @@ OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle)
                                   &deviceAttributes,
                                   &gOvsDeviceObject,
                                   &gOvsDeviceHandle);
-    if (status != NDIS_STATUS_SUCCESS) {
-        POVS_DEVICE_EXTENSION ovsExt =
-            (POVS_DEVICE_EXTENSION)NdisGetDeviceReservedExtension(gOvsDeviceObject);
-        ASSERT(gOvsDeviceObject != NULL);
-        ASSERT(gOvsDeviceHandle != NULL);
-
-        if (ovsExt) {
-            ovsExt->numberOpenInstance = 0;
-        }
-    } else {
+    if (status == NDIS_STATUS_SUCCESS) {
         OvsRegisterSystemProvider((PVOID)gOvsDeviceObject);
+    } else {
+        OVS_LOG_ERROR("Failed to regiser pseudo device, error: 0x%08x",
+                      status);
     }
 
     OVS_LOG_TRACE("DeviceObject: %p", gOvsDeviceObject);
-- 
2.6.2




More information about the dev mailing list