[openib-general] Re: Fwd: a bug
Roland Dreier
rdreier at cisco.com
Thu Apr 20 09:36:11 PDT 2006
Yes, good catch. I fixed it like this:
diff-tree 9efa84579338184e0139f1881f0a1b6ad0063fcc (from 52824b6b5fa0533e2b2adc9df396d0e9ff6fb02a)
Author: Roland Dreier <rolandd at cisco.com>
Date: Thu Apr 20 09:34:46 2006 -0700
IB/mthca: Fix offset in query_gid method
GuidInfo records have 8 byte GUIDs in then, 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 at mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd at cisco.com>
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 565a24b..a2eae8a 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -306,7 +306,7 @@ static int mthca_query_gid(struct ib_dev
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);
More information about the general
mailing list