diff mbox

[-next] IB/ipoib: Fix error return code in ipoib_dev_init()

Message ID 1531314942-178931-1-git-send-email-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Wei Yongjun July 11, 2018, 1:15 p.m. UTC
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>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


--
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

Comments

Yuval Shaia July 16, 2018, 8:25 p.m. UTC | #1
On Wed, Jul 11, 2018 at 01:15:42PM +0000, Wei Yongjun wrote:
> 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>
> ---
>  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 9bcd487..d11adfa 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 < 0) {
>  		pr_warn("%s failed to init neigh hash\n", dev->name);
>  		goto out_dev_uninit;
>  	}

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

> 
--
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
Jason Gunthorpe July 24, 2018, 8:57 p.m. UTC | #2
On Wed, Jul 11, 2018 at 01:15:42PM +0000, Wei Yongjun wrote:
> 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>
> ---
>  drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to for-next, thanks

> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index 9bcd487..d11adfa 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 < 0) {

However I changed this to the cannonical 'if (ret)' format.

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_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 9bcd487..d11adfa 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 < 0) {
 		pr_warn("%s failed to init neigh hash\n", dev->name);
 		goto out_dev_uninit;
 	}