]> err.no Git - linux-2.6/commitdiff
IB/mthca: Add missing sg_init_table() in mthca_map_user_db()
authorRoland Dreier <rolandd@cisco.com>
Tue, 12 Feb 2008 22:38:22 +0000 (14:38 -0800)
committerRoland Dreier <rolandd@cisco.com>
Tue, 12 Feb 2008 22:38:22 +0000 (14:38 -0800)
Usually harmless, since the scatterlist is always hard-coded to a length
of 1, but it triggers a BUG() if CONFIG_DEBUG_SG=y, so we better fix it.
This fixes <http://bugzilla.kernel.org/show_bug.cgi?id=9934>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_memfree.c

index 1f4d27d7c16d9d5f8741364e6d7b613ca8ba17af..252db0822f6cbc2e8d1f092b6c9965aa102142ef 100644 (file)
@@ -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;