Skip to contentSkip to conversation

infiniband-diags: saquery, properly free mad when no results are found

PATCH In review Ira Weiny 1 participant 1 message Apr 8, 2011 InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 2/3 infiniband-diags: saquery, properly free mad when no results are found

Subject: [PATCH 2/3] infiniband-diags: saquery, properly free mad when no results are found

---
 src/saquery.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
src/saquery.c +6 -2
index d7c8e6f..9314e4f 100644
@@ -876,11 +876,15 @@ static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 	if (ret)
 		return ret;
 
-	if (result.result_cnt == 0)
-		return ENODEV;
+	if (result.result_cnt == 0) {
+		ret = ENODEV;
+		goto Exit;
+	}
 
 	dump_results(&result, dump_func);
 
+Exit:
+	return_mad();
 	return 0;
 }
 
Signature · 6 lines
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html