WdfObjectAcquireLock(ep->Queue);\r
if (ep->State != WvEpRouteResolved) {\r
status = STATUS_NOT_SUPPORTED;\r
- goto release;\r
+ goto unlock;\r
}\r
\r
status = IbCmInterface.CM.create_id(WvEpIbCmHandler, ep, &ep->pIbCmId);\r
if (!NT_SUCCESS(status)) {\r
- goto release;\r
+ goto unlock;\r
}\r
\r
ep->State = WvEpActiveConnect;\r
- status = WdfRequestForwardToIoQueue(Request, ep->Queue);\r
+ status = IbCmInterface.CM.send_req(ep->pIbCmId, &req);\r
if (NT_SUCCESS(status)) {\r
- status = IbCmInterface.CM.send_req(ep->pIbCmId, &req);\r
+ status = WdfRequestForwardToIoQueue(Request, ep->Queue);\r
}\r
\r
if (!NT_SUCCESS(status)) {\r
ep->State = WvEpDisconnected;\r
}\r
-release:\r
+unlock:\r
WdfObjectReleaseLock(ep->Queue);\r
+release:\r
WvEpRelease(ep);\r
complete:\r
if (!NT_SUCCESS(status)) {\r
pEndpoint->State = WvEpConnected;\r
status = IbCmInterface.CM.send_rtu(pEndpoint->pIbCmId, pAttr->Param.Data,\r
pAttr->Param.DataLength);\r
- if (NT_SUCCESS(status)) {\r
- WdfRequestComplete(Request, STATUS_SUCCESS);\r
- } else {\r
+ if (!NT_SUCCESS(status)) {\r
pEndpoint->State = WvEpDisconnected;\r
}\r
\r
break;\r
case WvEpPassiveConnect:\r
status = WvEpAcceptPassive(Request, out, outlen, ep, pattr);\r
+ if (NT_SUCCESS(status)) {\r
+ WvEpRelease(ep);\r
+ return;\r
+ }\r
break;\r
default:\r
status = STATUS_NOT_SUPPORTED;\r
\r
WvEpRelease(ep);\r
complete:\r
- if (!NT_SUCCESS(status)) {\r
- WdfRequestComplete(Request, status);\r
- }\r
+ WdfRequestComplete(Request, status);\r
}\r
\r
void WvEpReject(WV_PROVIDER *pProvider, WDFREQUEST Request)\r
case WvEpConnected:\r
case WvEpActiveDisconnect:\r
status = WdfRequestForwardToIoQueue(Request, ep->Queue);\r
+ if (NT_SUCCESS(status)) {\r
+ WdfObjectReleaseLock(ep->Queue);\r
+ WvEpRelease(ep);\r
+ return;\r
+ }\r
break;\r
case WvEpPassiveDisconnect:\r
case WvEpDisconnected:\r
\r
WvEpRelease(ep);\r
complete:\r
- if (!NT_SUCCESS(status)) {\r
- WdfRequestComplete(Request, status);\r
- }\r
+ WdfRequestComplete(Request, status);\r
}\r
\r
static NTSTATUS WvEpIbListenHandler(iba_cm_id *pId, iba_cm_event *pEvent)\r
goto release;\r
}\r
\r
+ ASSERT(!IsListEmpty(&listen->Entry));\r
ep = CONTAINING_RECORD(RemoveHeadList(&listen->Entry), WV_ENDPOINT, Entry);\r
ep->pIbCmId = pId;\r
pId->callback = WvEpIbCmHandler;\r