Commit 06d25d3d authored by Alin Serdean's avatar Alin Serdean Committed by Ben Pfaff

Solved datapath-windows: BSOD when initializing switch context

Add check in case of NdisAllocateRWLock fails to allocate the resources.

Check datapath->lock before trying to free it.
Signed-off-by: default avatarAlin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-by: default avatarSorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/92Acked-by: default avatarSorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: default avatarBen Pfaff <blp@nicira.com>
parent cddc232f
......@@ -1513,6 +1513,11 @@ OvsDeleteFlowTable(OVS_DATAPATH *datapath)
DeleteAllFlows(datapath);
OvsFreeMemoryWithTag(datapath->flowTable, OVS_FLOW_POOL_TAG);
datapath->flowTable = NULL;
if (datapath->lock == NULL) {
return NDIS_STATUS_SUCCESS;
}
NdisFreeRWLock(datapath->lock);
return NDIS_STATUS_SUCCESS;
......@@ -1544,6 +1549,10 @@ OvsAllocateFlowTable(OVS_DATAPATH *datapath,
}
datapath->lock = NdisAllocateRWLock(switchContext->NdisFilterHandle);
if (!datapath->lock) {
return NDIS_STATUS_RESOURCES;
}
return NDIS_STATUS_SUCCESS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment