summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Switch.c
diff options
context:
space:
mode:
authorSorin Vinturis <svinturis@cloudbasesolutions.com>2015-05-28 20:30:57 +0000
committerBen Pfaff <blp@nicira.com>2015-06-15 20:17:37 -0700
commit8e2fe95e533b2b9277843baeccc3d00cefdf653e (patch)
tree3bb2d44d31b173d4c35c0eaec6e59539b96ac89a /datapath-windows/ovsext/Switch.c
parent72a5e2b8fc8c7c316c0b9feb96b7be5b19265c7c (diff)
downloadopenvswitch-8e2fe95e533b2b9277843baeccc3d00cefdf653e.tar.gz
datapath-windows: BSOD when disabling the extension
When the filter detach routine is called while there are packets still in processing, the OvsUninitSwitchContext function call will decrement the switch context reference count without releasing the switch context structure. This behaviour is correct and expected, but the BSOD is caused in this case because the gOvsSwitchContext variable is set to NULL, which is wrong. The gOvsSwitchContext global variable must be set to NULL only when the switch context structure is actually released. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/80 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Switch.c')
-rw-r--r--datapath-windows/ovsext/Switch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c
index f8778546c..99a306d26 100644
--- a/datapath-windows/ovsext/Switch.c
+++ b/datapath-windows/ovsext/Switch.c
@@ -201,6 +201,7 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle,
status = OvsInitSwitchContext(switchContext);
if (status != NDIS_STATUS_SUCCESS) {
OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG);
+ switchContext = NULL;
goto create_switch_done;
}
@@ -240,7 +241,6 @@ OvsExtDetach(NDIS_HANDLE filterModuleContext)
}
OvsDeleteSwitch(switchContext);
OvsCleanupIpHelper();
- gOvsSwitchContext = NULL;
/* This completes the cleanup, and a new attach can be handled now. */
OVS_LOG_TRACE("Exit: OvsDetach Successfully");
@@ -495,6 +495,7 @@ OvsReleaseSwitchContext(POVS_SWITCH_CONTEXT switchContext)
if (ref == 1) {
OvsDeleteSwitchContext(switchContext);
+ gOvsSwitchContext = NULL;
}
}