Blob Blame History Raw
From: Yuval Shaia <yuval.shaia@oracle.com>
Date: Wed, 13 Dec 2017 12:25:19 +0200
Subject: IB/ipoib: Restore MM behavior in case of tx_ring allocation failure
Patch-mainline: v4.15-rc4
Git-commit: 9d98e19ba08f6aa33a4a1414f3dfe8440e67530c
References: bsc#1046307 FATE#322941

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>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1138,6 +1138,7 @@ static int ipoib_cm_tx_init(struct ipoib
 	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;
 	}