The instance should be removed from pid-hash when vswitchd.exe terminates so
the driver won't access it during packet miss (causing BSOD)

Signed-off-by: Eitan Eliahu <[email protected]>
---
 datapath-windows/ovsext/User.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index db1b3de..f95f2ac 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -126,6 +126,11 @@ OvsCleanupPacketQueue(POVS_OPEN_INSTANCE instance)
     if (queue) {
         OvsFreeMemory(queue);
     }
+
+    OvsAcquireCtrlLock();
+    /* Remove the instance from pidHashArray */
+    OvsDelPidInstance(gOvsSwitchContext, instance->pid);
+    OvsReleaseCtrlLock();
 }
 
 NTSTATUS
@@ -146,12 +151,6 @@ OvsSubscribeDpIoctl(PVOID instanceP,
     if (instance->packetQueue && !join) {
         /* unsubscribe */
         OvsCleanupPacketQueue(instance);
-
-        OvsAcquireCtrlLock();
-        /* Remove the instance from pidHashArray */
-        OvsDelPidInstance(gOvsSwitchContext, pid);
-        OvsReleaseCtrlLock();
-
     } else if (instance->packetQueue == NULL && join) {
         queue = (POVS_USER_PACKET_QUEUE) OvsAllocateMemory(sizeof *queue);
         if (queue == NULL) {
-- 
1.9.4.msysgit.0

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to