Linux Kernels

IB/ipoib: Fix error return code in ipoib_dev_init()

This change “IB/ipoib: Fix error return code in ipoib_dev_init()” (commit 99a7e2b) in Linux kernel is authored by Wei Yongjun <weiyongjun1 [at] huawei.com> on Wed Jul 11 13:15:42 2018 +0000.

Description of "IB/ipoib: Fix error return code in ipoib_dev_init()"

The change “IB/ipoib: Fix error return code in ipoib_dev_init()” introduces changes as follows.

IB/ipoib: Fix error return code in ipoib_dev_init()

Fix to return a negative error code from the ipoib_neigh_hash_init()
error handling case instead of 0, as done elsewhere in this function.

Fixes: 515ed4f3aab4 ("IB/IPoIB: Separate control and data related initializations")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

Linux kernel releases containing commit 99a7e2b

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes in "IB/ipoib: Fix error return code in ipoib_dev_init()"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 012c9e3970ac..82f0e3869b04 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1791,7 +1791,8 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port)
 		goto out_free_pd;
 	}
 
-	if (ipoib_neigh_hash_init(priv) < 0) {
+	ret = ipoib_neigh_hash_init(priv);
+	if (ret) {
 		pr_warn("%s failed to init neigh hash\n", dev->name);
 		goto out_dev_uninit;
 	}

The commit for this change in Linux stable tree is 99a7e2b (patch).

Last modified: 2020/01/11 10:05