Skip to content

Commit

Permalink
IB/mthca: Fix thinko in init_mr_table()
Browse files Browse the repository at this point in the history
Commit c20e20a ("IB/mthca: Merge MR and FMR space on 64-bit systems")
swapped the number of MTTs and MPTs when initializing the MR table. As
a result, we get a kernel oops when the number of MTT segments
allocated exceeds 0x20000.

Noted by Troy Benjegerdes <troy@scl.ameslab.gov>, and reproduced by
Dotan Barak <dotanb@mellanox.co.il>.  This fixes
https://bugs.openfabrics.org/show_bug.cgi?id=490

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Mar 26, 2007
1 parent ed6ee51 commit 0264d88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/mthca/mthca_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,8 @@ int mthca_init_mr_table(struct mthca_dev *dev)
}
mpts = mtts = 1 << i;
} else {
mpts = dev->limits.num_mtt_segs;
mtts = dev->limits.num_mpts;
mtts = dev->limits.num_mtt_segs;
mpts = dev->limits.num_mpts;
}

if (!mthca_is_memfree(dev) &&
Expand Down

0 comments on commit 0264d88

Please sign in to comment.