Skip to content

Commit

Permalink
IB/mthca: Free correct MPT on error exit from mthca_fmr_alloc()
Browse files Browse the repository at this point in the history
When mthca_fmr_alloc() returns an error, it should free the MPT at the
index key, not mr->ibmr.lkey, since the lkey has been mangled by
hw_index_to_key() and no longer is the real index.  This bug causes
corruption of the MPT table free bitmap when mthca_fmr_alloc() fails.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Feb 19, 2008
1 parent ec229e5 commit b7f9c11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mthca/mthca_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ int mthca_fmr_alloc(struct mthca_dev *dev, u32 pd,
mthca_table_put(dev, dev->mr_table.mpt_table, key);

err_out_mpt_free:
mthca_free(&dev->mr_table.mpt_alloc, mr->ibmr.lkey);
mthca_free(&dev->mr_table.mpt_alloc, key);
return err;
}

Expand Down

0 comments on commit b7f9c11

Please sign in to comment.