[openib-general] [PATCH] ib_mad: In ib_mad_complete_recv, decrement agent refcount when not fully reassembled and when no request found

Hal Rosenstock halr at voltaire.com
Sun Oct 24 10:38:01 PDT 2004


ib_mad: In ib_mad_complete_recv, decrement agent reference count when
receive is not fully reassembled, and also when solicited and no
matching request is found. This allows deregistration to complete rather
than waiting for an event which never occurs.

Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 1044)
+++ ib_mad.c	(working copy)
@@ -873,8 +873,10 @@
 
 	/* Fully reassemble receive before processing */
 	recv = reassemble_recv(mad_agent_priv, recv);
-	if (!recv)
+	if (!recv) {
+		atomic_dec(&mad_agent_priv->refcount);
 		return;
+	}
 
 	/* Complete corresponding request */
 	if (solicited) {
@@ -884,6 +886,7 @@
 		if (!mad_send_wr) {
 			spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
 			ib_free_recv_mad(&recv->header.recv_wc);
+			atomic_dec(&mad_agent_priv->refcount);
 			return;
 		}
 		/* Timeout = 0 means that we won't wait for a response */






More information about the general mailing list