Skip to content

Commit

Permalink
[PATCH] IB/mthca: fix MR allocation error path
Browse files Browse the repository at this point in the history
Fix error handling in MR allocation for mem-free mode: mthca_free must get an
MR index, not a key.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Michael S. Tsirkin authored and Linus Torvalds committed Apr 16, 2005
1 parent 85665c9 commit 55645e9
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 @@ -231,7 +231,7 @@ int mthca_mr_alloc_notrans(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);
kfree(mailbox);
return err;
}
Expand Down Expand Up @@ -368,7 +368,7 @@ int mthca_mr_alloc_phys(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 55645e9

Please sign in to comment.