[ofw] [Patch 57/62] Reference implementation of NDv2

Fab Tillier ftillier at microsoft.com
Wed Feb 20 21:09:42 PST 2013


IBAL: Fix kal_cep_format_event to return a properly formatted event if CEP lookup fails

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -dwup3 -X excl.txt -I ^ \*$ -I ^ \* \$ -r \dev\openib\Mellanox\11011\core\al\kernel\al_cm_cep.c .\core\al\kernel\al_cm_cep.c
--- \dev\openib\Mellanox\11011\core\al\kernel\al_cm_cep.c	Thu Sep 20 17:51:02 2012
+++ .\core\al\kernel\al_cm_cep.c	Tue Oct 16 14:53:19 2012
@@ -6283,18 +6283,17 @@ kal_cep_format_event(
 	KLOCK_QUEUE_HANDLE	hdl;
 	kcep_t				*p_cep;
 	
-	KeAcquireInStackQueuedSpinLock( &gp_cep_mgr->lock, &hdl );
-	p_cep = __lookup_cep( h_al, cid );
-	KeReleaseInStackQueuedSpinLock( &hdl );
-
 	switch (p_mad->p_mad_buf->attr_id) {
 	case CM_REQ_ATTR_ID:
-		if (p_mad->status == IB_SUCCESS) {
+		KeAcquireInStackQueuedSpinLock( &gp_cep_mgr->lock, &hdl );
+		p_cep = __lookup_cep( h_al, cid );
+		if (p_mad->status == IB_SUCCESS && p_cep != NULL) {
 			p_event->type = iba_cm_req_received;
 			__format_event_req(p_cep, (mad_cm_req_t*) p_mad->p_mad_buf, &p_event->data.req);
 		} else {
 			p_event->type = iba_cm_req_error;
 		}
+		KeReleaseInStackQueuedSpinLock( &hdl );
 		break;
 	case CM_REP_ATTR_ID:
 		if (p_mad->status == IB_SUCCESS) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ndv2.57.patch
Type: application/octet-stream
Size: 1084 bytes
Desc: ndv2.57.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20130221/a4f9886d/attachment.obj>


More information about the ofw mailing list