From 831308e0eebda1097a8eddeb20625281fa0f88cf Mon Sep 17 00:00:00 2001 From: Dotan Barak Date: Wed, 8 Aug 2007 16:27:08 +0300 Subject: Initialize reserved attributes in modify QP command Initialize the reserved attributes in modify QP command to eliminate valgrind warnings like: ==23549== Syscall param write(buf) points to uninitialised byte(s) ==23549== at 0x316B1B933F: (within /lib64/tls/libc-2.3.4.so) ==23549== by 0x4A33AF7: ibv_cmd_modify_qp (cmd.c:782) ==23549== by 0x4F860D8: mlx4_modify_qp (verbs.c:480) ==23549== by 0x4A37A53: ibv_modify_qp@@IBVERBS_1.1 (verbs.c:441) ==23549== by 0x40972E: qp_reset_to_rtr (mr_test_fun.c:1189) ==23549== by 0x403AFC: mr_test_connect_qp (mr_test.c:232) ==23549== by 0x404956: do_test (mr_test.c:85) ==23549== by 0x402DF8: main (main.c:448) ==23549== Address 0x7FEFFF2AE is on thread 1's stack Signed-off-by: Dotan Barak Signed-off-by: Roland Dreier (cherry picked from commit d5052fa0bf8180be9edf1c4c1c014dde01f8a4dd) --- src/cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd.c b/src/cmd.c index 2f17765..d8eef6c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -747,6 +747,7 @@ int ibv_cmd_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, memcpy(cmd->dest.dgid, attr->ah_attr.grh.dgid.raw, 16); cmd->dest.flow_label = attr->ah_attr.grh.flow_label; cmd->dest.dlid = attr->ah_attr.dlid; + cmd->dest.reserved = 0; cmd->dest.sgid_index = attr->ah_attr.grh.sgid_index; cmd->dest.hop_limit = attr->ah_attr.grh.hop_limit; cmd->dest.traffic_class = attr->ah_attr.grh.traffic_class; @@ -759,6 +760,7 @@ int ibv_cmd_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, memcpy(cmd->alt_dest.dgid, attr->alt_ah_attr.grh.dgid.raw, 16); cmd->alt_dest.flow_label = attr->alt_ah_attr.grh.flow_label; cmd->alt_dest.dlid = attr->alt_ah_attr.dlid; + cmd->alt_dest.reserved = 0; cmd->alt_dest.sgid_index = attr->alt_ah_attr.grh.sgid_index; cmd->alt_dest.hop_limit = attr->alt_ah_attr.grh.hop_limit; cmd->alt_dest.traffic_class = attr->alt_ah_attr.grh.traffic_class; -- cgit 1.2.3-korg