diff mbox

IB/ipoib: Remove device when one port fails to init

Message ID 1506341880-41082-1-git-send-email-yuval.shaia@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Yuval Shaia Sept. 25, 2017, 12:18 p.m. UTC
Call ipoib_remove_one when one of the IPoIB ports fails to initialize in
order not to leave the module in unstable state.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Doug Ledford Sept. 27, 2017, 1:48 p.m. UTC | #1
On Mon, 2017-09-25 at 05:18 -0700, Yuval Shaia wrote:
> Call ipoib_remove_one when one of the IPoIB ports fails to initialize
> in
> order not to leave the module in unstable state.
> 
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index a6bcd78..5ffd2c3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2295,7 +2295,8 @@  static void ipoib_add_one(struct ib_device *device)
 	}
 
 	if (!count) {
-		kfree(dev_list);
+		pr_err("Failed to init port, removing it\n");
+		ipoib_remove_one(device, dev_list);
 		return;
 	}