diff mbox

IB/ipoib: Restore MM behavior in case of tx_ring allocation failure

Message ID 20171213102519.4929-1-yuval.shaia@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Yuval Shaia Dec. 13, 2017, 10:25 a.m. UTC
memalloc_noio_save modifies the behavior of MM, we must restore it after
we are done.

Fixes: d83187dda9b9 IB/IPoIB: Convert IPoIB to memalloc_noio_* calls

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jason Gunthorpe Dec. 13, 2017, 5:31 p.m. UTC | #1
On Wed, Dec 13, 2017 at 12:25:19PM +0200, Yuval Shaia wrote:
> memalloc_noio_save modifies the behavior of MM, we must restore it after
> we are done.
> 
> Fixes: d83187dda9b9 IB/IPoIB: Convert IPoIB to memalloc_noio_* calls
> 
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
>  drivers/infiniband/ulp/ipoib/ipoib_cm.c | 1 +
>  1 file changed, 1 insertion(+)

Applied to for-rc thanks

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 87f4bd99cdf7..2c13123bfd69 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1145,6 +1145,7 @@  static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
 	noio_flag = memalloc_noio_save();
 	p->tx_ring = vzalloc(ipoib_sendq_size * sizeof(*p->tx_ring));
 	if (!p->tx_ring) {
+		memalloc_noio_restore(noio_flag);
 		ret = -ENOMEM;
 		goto err_tx;
 	}