Skip to content

Commit 99d4f22

Browse files
author
Roland Dreier
committed
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 <[email protected]>. Signed-off-by: Roland Dreier <[email protected]>
1 parent 66efc5a commit 99d4f22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/mthca/mthca_qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static int to_ib_qp_access_flags(int mthca_flags)
399399
static void to_ib_ah_attr(struct mthca_dev *dev, struct ib_ah_attr *ib_ah_attr,
400400
struct mthca_qp_path *path)
401401
{
402-
memset(ib_ah_attr, 0, sizeof *path);
402+
memset(ib_ah_attr, 0, sizeof *ib_ah_attr);
403403
ib_ah_attr->port_num = (be32_to_cpu(path->port_pkey) >> 24) & 0x3;
404404

405405
if (ib_ah_attr->port_num == 0 || ib_ah_attr->port_num > dev->limits.num_ports)

0 commit comments

Comments
 (0)