net: hns3: bugfix for not checking return value
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 8 Nov 2018 02:13:19 +0000 (10:13 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2018 00:23:49 +0000 (16:23 -0800)
hns3_reset_notify_init_enet() only return error early if the return
value of hns3_restore_vlan() is not 0.

This patch adds checking for the return value of hns3_restore_vlan.

Fixes: 7fa6be4fd2f6 ("net: hns3: fix incorrect return value/type of some functions")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 3f96aa30068ec3dcf991bec4ed022b3e68d013e7..20fcf0d1c2ce5f8ec986928019aefbd209088731 100644 (file)
@@ -3760,7 +3760,8 @@ static int hns3_reset_notify_init_enet(struct hnae3_handle *handle)
        /* Hardware table is only clear when pf resets */
        if (!(handle->flags & HNAE3_SUPPORT_VF)) {
                ret = hns3_restore_vlan(netdev);
-               return ret;
+               if (ret)
+                       return ret;
        }
 
        ret = hns3_restore_fd_rules(netdev);