[ofa-general] [PATCH] libmthca: prevent seg fault when sending big messages as inline

Dotan Barak dotanb at dev.mellanox.co.il
Sun Jan 13 07:37:20 PST 2008


Fix the type of the variable that hold the number of bytes sent 
as inline message so far.
If the user will try to use very big messages (total > 2^31) there
will be seg fault.

Signed-off-by: Dotan Barak <dotanb at dev.mellanox.co.il>

---

diff --git a/src/qp.c b/src/qp.c
index 2ea9dc0..cb290ec 100644
--- a/src/qp.c
+++ b/src/qp.c
@@ -244,7 +244,7 @@ int mthca_tavor_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 		if (wr->send_flags & IBV_SEND_INLINE) {
 			if (wr->num_sge) {
 				struct mthca_inline_seg *seg = wqe;
-				int s = 0;
+				unsigned int s = 0;
 
 				wqe += sizeof *seg;
 				for (i = 0; i < wr->num_sge; ++i) {



More information about the general mailing list