datapath-windows: Avoid BSOD when cleaning up a tunnel vport
authorSorin Vinturis <svinturis@cloudbasesolutions.com>
Tue, 28 Jul 2015 10:04:07 +0000 (10:04 +0000)
committerBen Pfaff <blp@nicira.com>
Tue, 28 Jul 2015 15:16:41 +0000 (08:16 -0700)
If an error appears when creating a tunnel vport the cleanup is performed
twice, which causes the tunnel vport to be released also twice and
generate a BSOD.

This patch modifies the tunnel filter cleanup logic to avoid this issue.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/97
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/TunnelFilter.c
datapath-windows/ovsext/Vport.c

index 231750e..55db7fa 100644 (file)
@@ -1419,7 +1419,6 @@ OvsTunnelFilterQueueRequest(PIRP irp,
     } while (error);
 
     if (error) {
-        OvsTunnelFilterCompleteRequest(irp, callback, tunnelContext, status);
         if (request) {
             OvsFreeMemory(request);
             request = NULL;
index d692a6d..59cf651 100644 (file)
@@ -920,7 +920,8 @@ OvsInitTunnelVport(PVOID userContext,
     {
         POVS_TUNFLT_INIT_CONTEXT tunnelContext = NULL;
 
-        tunnelContext = OvsAllocateMemory(sizeof(*tunnelContext));
+        tunnelContext = OvsAllocateMemoryWithTag(sizeof(*tunnelContext),
+                                                 OVS_VPORT_POOL_TAG);
         if (tunnelContext == NULL) {
             status = STATUS_INSUFFICIENT_RESOURCES;
             break;
@@ -935,6 +936,10 @@ OvsInitTunnelVport(PVOID userContext,
                                     dstPort,
                                     OvsTunnelVportPendingInit,
                                     (PVOID)tunnelContext);
+        if (status != STATUS_PENDING) {
+            OvsFreeMemoryWithTag(tunnelContext, OVS_VPORT_POOL_TAG);
+            tunnelContext = NULL;
+        }
         break;
     }
     case OVS_VPORT_TYPE_STT: