]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: hns3: bugfix for not checking return value
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 8 Nov 2018 02:13:19 +0000 (10:13 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: https://bugs.launchpad.net/bugs/1810457
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>
(cherry picked from commit e12c225258f2584906765234ca6db4ad4c618192)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 30a828e0d5ff61c4ab87c79287ebb8dea6d39f09..5c8630f8ac1cade1c5c1f9d46841c8773d37c096 100644 (file)
@@ -3758,7 +3758,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);