IB/ipoib: Fix error return code in ipoib_dev_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 11 Jul 2018 13:15:42 +0000 (13:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:00 +0000 (08:38 +0200)
[ Upstream commit 99a7e2bf704d64c966dfacede1ba2d9b47cb676e ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 6bc9a768f72193ef0a9b3ad00ed4e9f4da8f23d1..e6ff16b27acdb6c65a234c8536ffcdb87b690cd5 100644 (file)
@@ -1752,7 +1752,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;
        }