[ofw] [PATCH 03/15] uDAPL v2.0 common: dapls_ep_flush_cq will segfault when no CQ is attached to EP

Davis, Arlin R arlin.r.davis at intel.com
Mon Apr 23 13:00:50 PDT 2012


add check for NULL request/receive EVD (cq) before flushing.

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

diff --git a/dapl/common/dapl_ep_util.c b/dapl/common/dapl_ep_util.c
index 6646528..5133f59 100644
--- a/dapl/common/dapl_ep_util.c
+++ b/dapl/common/dapl_ep_util.c
@@ -620,9 +620,11 @@ static void dapli_ep_flush_evd(DAPL_EVD *evd_ptr)
 
 void dapls_ep_flush_cqs(DAPL_EP * ep_ptr)
 {
-	dapli_ep_flush_evd((DAPL_EVD *) ep_ptr->param.request_evd_handle);
-	while (dapls_cb_pending(&ep_ptr->recv_buffer))
-		dapli_ep_flush_evd((DAPL_EVD *) ep_ptr->param.recv_evd_handle);
+	if (ep_ptr->param.request_evd_handle)
+		dapli_ep_flush_evd((DAPL_EVD *) ep_ptr->param.request_evd_handle);
+	if (ep_ptr->param.recv_evd_handle)
+		while (dapls_cb_pending(&ep_ptr->recv_buffer))
+			dapli_ep_flush_evd((DAPL_EVD *) ep_ptr->param.recv_evd_handle);
 }
 
 /*
-- 
1.7.3






More information about the ofw mailing list