IB/hfi1: Fix error return code in hfi1_init_dd()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Fri, 13 Nov 2020 06:42:27 +0000 (14:42 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 13 Nov 2020 16:25:21 +0000 (12:25 -0400)
Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev")
Link: https://lore.kernel.org/r/1605249747-17942-1-git-send-email-zhangchangzhong@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hfi1/chip.c

index 7eaf995..c87b94e 100644 (file)
@@ -15245,7 +15245,8 @@ int hfi1_init_dd(struct hfi1_devdata *dd)
                    & CCE_REVISION_SW_MASK);
 
        /* alloc netdev data */
-       if (hfi1_netdev_alloc(dd))
+       ret = hfi1_netdev_alloc(dd);
+       if (ret)
                goto bail_cleanup;
 
        ret = set_up_context_variables(dd);