Skip to content

Commit

Permalink
IB/mthca: Fix offset in query_gid method
Browse files Browse the repository at this point in the history
GuidInfo records have 8 byte GUIDs in them, so an index should be
multiplied by 8 to get an offset.  mthca_query_gid() was incorrectly
multiplying by 16.

Noticed by Leonid Keller <leonid@mellanox.co.il>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed May 1, 2006
1 parent 1f4a906 commit 254abfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mthca/mthca_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static int mthca_query_gid(struct ib_device *ibdev, u8 port,
goto out;
}

memcpy(gid->raw + 8, out_mad->data + (index % 8) * 16, 8);
memcpy(gid->raw + 8, out_mad->data + (index % 8) * 8, 8);

out:
kfree(in_mad);
Expand Down

0 comments on commit 254abfd

Please sign in to comment.