aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 7bb5d4f6bb90..d2f9f2e57298 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1681,10 +1681,8 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid,
1681 return ERR_PTR(-ENOMEM); 1681 return ERR_PTR(-ENOMEM);
1682 1682
1683 retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd); 1683 retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd);
1684 if (retval < 0) { 1684 BUG_ON(retval < 0);
1685 kfree_skb(skb); 1685
1686 return ERR_PTR(retval);
1687 }
1688 return skb; 1686 return skb;
1689} 1687}
1690 1688
@@ -1814,25 +1812,33 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
1814 nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) 1812 nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type)
1815 err = -EINVAL; 1813 err = -EINVAL;
1816 1814
1815 reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
1816 if (!reply) {
1817 err = -ENOMEM;
1818 goto exit_unlock;
1819 }
1820
1817 if (!err && a[OVS_VPORT_ATTR_OPTIONS]) 1821 if (!err && a[OVS_VPORT_ATTR_OPTIONS])
1818 err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]); 1822 err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]);
1819 if (err) 1823 if (err)
1820 goto exit_unlock; 1824 goto exit_free;
1825
1821 if (a[OVS_VPORT_ATTR_UPCALL_PID]) 1826 if (a[OVS_VPORT_ATTR_UPCALL_PID])
1822 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); 1827 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
1823 1828
1824 reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, 1829 err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid,
1825 OVS_VPORT_CMD_NEW); 1830 info->snd_seq, 0, OVS_VPORT_CMD_NEW);
1826 if (IS_ERR(reply)) { 1831 BUG_ON(err < 0);
1827 netlink_set_err(sock_net(skb->sk)->genl_sock, 0,
1828 ovs_dp_vport_multicast_group.id, PTR_ERR(reply));
1829 goto exit_unlock;
1830 }
1831 1832
1832 ovs_unlock(); 1833 ovs_unlock();
1833 ovs_notify(reply, info, &ovs_dp_vport_multicast_group); 1834 ovs_notify(reply, info, &ovs_dp_vport_multicast_group);
1834 return 0; 1835 return 0;
1835 1836
1837 rtnl_unlock();
1838 return 0;
1839
1840exit_free:
1841 kfree_skb(reply);
1836exit_unlock: 1842exit_unlock:
1837 ovs_unlock(); 1843 ovs_unlock();
1838 return err; 1844 return err;