[ofa-general] [PATCH] EHCA: Enforce a positive guid_entry index

Roel Kluin roel.kluin at gmail.com
Mon Jun 15 11:04:08 PDT 2009


This prevents the memcpy of a guid_entries element using a negative index.

Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
---
 drivers/infiniband/hw/ehca/ehca_hca.c    |    2 +-
 drivers/infiniband/hw/ehca/ehca_iverbs.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index 9209c53..1175ee1 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -311,7 +311,7 @@ query_pkey1:
 }
 
 int ehca_query_gid(struct ib_device *ibdev, u8 port,
-		   int index, union ib_gid *gid)
+		   unsigned index, union ib_gid *gid)
 {
 	int ret = 0;
 	u64 h_ret;
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h
index 8f7f282..05a83bb 100644
--- a/drivers/infiniband/hw/ehca/ehca_iverbs.h
+++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h
@@ -54,7 +54,7 @@ int ehca_query_sma_attr(struct ehca_shca *shca, u8 port,
 
 int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 * pkey);
 
-int ehca_query_gid(struct ib_device *ibdev, u8 port, int index,
+int ehca_query_gid(struct ib_device *ibdev, u8 port, unsigned index,
 		   union ib_gid *gid);
 
 int ehca_modify_port(struct ib_device *ibdev, u8 port, int port_modify_mask,



More information about the general mailing list