]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Initialize reserved attributes in modify QP command
authorDotan Barak <dotanb@dev.mellanox.co.il>
Wed, 8 Aug 2007 13:27:08 +0000 (16:27 +0300)
committerRoland Dreier <rolandd@cisco.com>
Mon, 13 Aug 2007 15:53:48 +0000 (08:53 -0700)
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 <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/cmd.c

index a0bfaad3de743a87f9a5d7b68d7d47ffdddf63cc..6d4331f7552f899096dfe3fd903a4d4428e6aa67 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -756,6 +756,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;
@@ -768,6 +769,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;