diff mbox

libibnetdiscover: more outstanding MADs counting fix

Message ID 20100418155636.GJ11943@me (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sasha Khapyorsky April 18, 2010, 3:56 p.m. UTC
None
diff mbox

Patch

diff --git a/infiniband-diags/libibnetdisc/src/query_smp.c b/infiniband-diags/libibnetdisc/src/query_smp.c
index 08e3ef7..3d10977 100644
--- a/infiniband-diags/libibnetdisc/src/query_smp.c
+++ b/infiniband-diags/libibnetdisc/src/query_smp.c
@@ -160,8 +160,6 @@  static int process_one_recv(smp_engine_t * engine)
 		return -1;
 	}
 
-	rc = process_smp_queue(engine);
-
 	mad = umad_get_mad(umad);
 	trid = (uint32_t) mad_get_field64(mad, 0, IB_MAD_TRID_F);
 
@@ -171,6 +169,8 @@  static int process_one_recv(smp_engine_t * engine)
 		return -1;
 	}
 
+	engine->num_smps_outstanding--;
+	rc = process_smp_queue(engine);
 	if (rc)
 		goto error;
 
@@ -187,7 +187,6 @@  static int process_one_recv(smp_engine_t * engine)
 
 error:
 	free(smp);
-	engine->num_smps_outstanding--;
 	return rc;
 }