Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55645e9b authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Linus Torvalds
Browse files

[PATCH] IB/mthca: fix MR allocation error path



Fix error handling in MR allocation for mem-free mode: mthca_free must get an
MR index, not a key.

Signed-off-by: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 85665c98
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}
@@ -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;
}