aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/openvswitch/datapath.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index d12d6b8b5e8b..748aa97cbfb2 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1812,10 +1812,11 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
1812 if (IS_ERR(vport)) 1812 if (IS_ERR(vport))
1813 goto exit_unlock; 1813 goto exit_unlock;
1814 1814
1815 err = 0;
1816 if (a[OVS_VPORT_ATTR_TYPE] && 1815 if (a[OVS_VPORT_ATTR_TYPE] &&
1817 nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) 1816 nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) {
1818 err = -EINVAL; 1817 err = -EINVAL;
1818 goto exit_unlock;
1819 }
1819 1820
1820 reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); 1821 reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
1821 if (!reply) { 1822 if (!reply) {
@@ -1823,10 +1824,11 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
1823 goto exit_unlock; 1824 goto exit_unlock;
1824 } 1825 }
1825 1826
1826 if (!err && a[OVS_VPORT_ATTR_OPTIONS]) 1827 if (a[OVS_VPORT_ATTR_OPTIONS]) {
1827 err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]); 1828 err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]);
1828 if (err) 1829 if (err)
1829 goto exit_free; 1830 goto exit_free;
1831 }
1830 1832
1831 if (a[OVS_VPORT_ATTR_UPCALL_PID]) 1833 if (a[OVS_VPORT_ATTR_UPCALL_PID])
1832 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); 1834 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);