]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
common: check for valid states during ep posting
authorArlin Davis <arlin.r.davis@intel.com>
Thu, 10 May 2012 21:57:31 +0000 (14:57 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Thu, 10 May 2012 21:57:31 +0000 (14:57 -0700)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/common/dapl_ep_util.c

index 5133f598d3007377201ed24a678879a5ed57fdfb..8ceb1bed3555abd0fd52f248ba9e9aa1df64a9a3 100644 (file)
@@ -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.