Commit 99d4f22e authored by Roland Dreier's avatar Roland Dreier

IB/mthca: Use correct structure size in call to memset()

When clearing the ib_ah_attr parameter in to_ib_ah_attr(), use sizeof
*ib_ah_attr instead of sizeof *path.

Pointed out by Jack Morgenstein <jackm@mellanox.co.il>.
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 66efc5a7
...@@ -399,7 +399,7 @@ static int to_ib_qp_access_flags(int mthca_flags) ...@@ -399,7 +399,7 @@ static int to_ib_qp_access_flags(int mthca_flags)
static void to_ib_ah_attr(struct mthca_dev *dev, struct ib_ah_attr *ib_ah_attr, static void to_ib_ah_attr(struct mthca_dev *dev, struct ib_ah_attr *ib_ah_attr,
struct mthca_qp_path *path) struct mthca_qp_path *path)
{ {
memset(ib_ah_attr, 0, sizeof *path); memset(ib_ah_attr, 0, sizeof *ib_ah_attr);
ib_ah_attr->port_num = (be32_to_cpu(path->port_pkey) >> 24) & 0x3; ib_ah_attr->port_num = (be32_to_cpu(path->port_pkey) >> 24) & 0x3;
if (ib_ah_attr->port_num == 0 || ib_ah_attr->port_num > dev->limits.num_ports) if (ib_ah_attr->port_num == 0 || ib_ah_attr->port_num > dev->limits.num_ports)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment