Merge tag 'v3.10.72' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / core / rtnetlink.c
index 1b068448d0ea9e63f04f6b634d244971bb15c406..7e051eef26134b532cec6dbcbadc9de0fa1098d5 100644 (file)
@@ -1149,14 +1149,10 @@ static const struct nla_policy ifla_vfinfo_policy[IFLA_VF_INFO_MAX+1] = {
 };
 
 static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
-       [IFLA_VF_MAC]           = { .type = NLA_BINARY,
-                                   .len = sizeof(struct ifla_vf_mac) },
-       [IFLA_VF_VLAN]          = { .type = NLA_BINARY,
-                                   .len = sizeof(struct ifla_vf_vlan) },
-       [IFLA_VF_TX_RATE]       = { .type = NLA_BINARY,
-                                   .len = sizeof(struct ifla_vf_tx_rate) },
-       [IFLA_VF_SPOOFCHK]      = { .type = NLA_BINARY,
-                                   .len = sizeof(struct ifla_vf_spoofchk) },
+       [IFLA_VF_MAC]           = { .len = sizeof(struct ifla_vf_mac) },
+       [IFLA_VF_VLAN]          = { .len = sizeof(struct ifla_vf_vlan) },
+       [IFLA_VF_TX_RATE]       = { .len = sizeof(struct ifla_vf_tx_rate) },
+       [IFLA_VF_SPOOFCHK]      = { .len = sizeof(struct ifla_vf_spoofchk) },
 };
 
 static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = {
@@ -1866,8 +1862,16 @@ replay:
                        goto out;
 
                err = rtnl_configure_link(dev, ifm);
-               if (err < 0)
-                       unregister_netdevice(dev);
+               if (err < 0) {
+                       if (ops->newlink) {
+                               LIST_HEAD(list_kill);
+
+                               ops->dellink(dev, &list_kill);
+                               unregister_netdevice_many(&list_kill);
+                       } else {
+                               unregister_netdevice(dev);
+                       }
+               }
 out:
                put_net(dest_net);
                return err;