[ofa-general] [PATCH] mthca memfree init sg list

Pete Wyckoff pw at osc.edu
Tue Feb 12 13:38:20 PST 2008


Properly initialize the SG list in the user_db_table in mthca memfree.
Without this, and when compiling with CONFIG_DEBUG_SG, a BUG will occur
during create_cq.  The call to sg_set_page() in mthca_map_user_db()
will find that the scatterlist magic was not initialized.

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
 drivers/infiniband/hw/mthca/mthca_memfree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c
index 1f4d27d..252db08 100644
--- a/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -542,6 +542,7 @@ struct mthca_user_db_table *mthca_init_user_db_tab(struct mthca_dev *dev)
 	for (i = 0; i < npages; ++i) {
 		db_tab->page[i].refcount = 0;
 		db_tab->page[i].uvirt    = 0;
+		sg_init_table(&db_tab->page[i].mem, 1);
 	}
 
 	return db_tab;
-- 
1.5.3.8





More information about the general mailing list