瀏覽代碼

IB/mthca: Fix offset in query_gid method

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>
Roland Dreier 19 年之前
父節點
當前提交
254abfd33a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/infiniband/hw/mthca/mthca_provider.c

+ 1 - 1
drivers/infiniband/hw/mthca/mthca_provider.c

@@ -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);