diff mbox

[5/7] common: check for valid states during ep posting

Message ID 54347E5A035A054EAE9D05927FB467F9481A87F4@ORSMSX101.amr.corp.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Arlin Davis July 5, 2012, 4:38 p.m. UTC
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>

---
 dapl/common/dapl_ep_util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

-- 
1.7.3
diff mbox

Patch

diff --git a/dapl/common/dapl_ep_util.c b/dapl/common/dapl_ep_util.c
index 5133f59..8ceb1be 100644
--- a/dapl/common/dapl_ep_util.c
+++ b/dapl/common/dapl_ep_util.c
@@ -352,6 +352,10 @@  dapl_ep_post_send_req(IN DAT_EP_HANDLE ep_handle,
 
 	ep_ptr = (DAPL_EP *) ep_handle;
 
+	if ((ep_ptr->param.ep_state != DAT_EP_STATE_CONNECTED) &&
+	    (ep_ptr->param.ep_state != DAT_EP_STATE_DISCONNECTED))
+		return(DAT_ERROR(DAT_INVALID_STATE, DAT_INVALID_STATE_EP_UNCONNECTED));
+
 	/*
 	 * Synchronization ok since this buffer is only used for send
 	 * requests, which aren't allowed to race with each other.