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

Davis, Arlin R arlin.r.davis at intel.com
Thu Jul 5 09:38:33 PDT 2012


Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/common/dapl_ep_util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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.
-- 
1.7.3






More information about the ofw mailing list