diff options
| author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-05-02 17:37:49 +0200 | 
|---|---|---|
| committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-05-02 17:54:19 +0200 | 
| commit | c032862fba51a3ca504752d3a25186b324c5ce83 (patch) | |
| tree | 955dc2ba4ab3df76ecc2bb780ee84aca04967e8d /net/openvswitch/datapath.c | |
| parent | fda76e074c7737fc57855dd17c762e50ed526052 (diff) | |
| parent | 8700c95adb033843fc163d112b9d21d4fda78018 (diff) | |
| download | olio-linux-3.10-c032862fba51a3ca504752d3a25186b324c5ce83.tar.xz olio-linux-3.10-c032862fba51a3ca504752d3a25186b324c5ce83.zip  | |
Merge commit '8700c95adb03' into timers/nohz
The full dynticks tree needs the latest RCU and sched
upstream updates in order to fix some dependencies.
Merge a common upstream merge point that has these
updates.
Conflicts:
	include/linux/perf_event.h
	kernel/rcutree.h
	kernel/rcutree_plugin.h
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'net/openvswitch/datapath.c')
| -rw-r--r-- | net/openvswitch/datapath.c | 33 | 
1 files changed, 21 insertions, 12 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index e87a26506db..6980c3e6f06 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -394,6 +394,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,  	skb_copy_and_csum_dev(skb, nla_data(nla)); +	genlmsg_end(user_skb, upcall);  	err = genlmsg_unicast(net, user_skb, upcall_info->portid);  out: @@ -1592,10 +1593,8 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid,  		return ERR_PTR(-ENOMEM);  	retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd); -	if (retval < 0) { -		kfree_skb(skb); -		return ERR_PTR(retval); -	} +	BUG_ON(retval < 0); +  	return skb;  } @@ -1690,6 +1689,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)  	if (IS_ERR(vport))  		goto exit_unlock; +	err = 0;  	reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,  					 OVS_VPORT_CMD_NEW);  	if (IS_ERR(reply)) { @@ -1724,24 +1724,32 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)  	    nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type)  		err = -EINVAL; +	reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); +	if (!reply) { +		err = -ENOMEM; +		goto exit_unlock; +	} +  	if (!err && a[OVS_VPORT_ATTR_OPTIONS])  		err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]);  	if (err) -		goto exit_unlock; +		goto exit_free; +  	if (a[OVS_VPORT_ATTR_UPCALL_PID])  		vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); -	reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, -					 OVS_VPORT_CMD_NEW); -	if (IS_ERR(reply)) { -		netlink_set_err(sock_net(skb->sk)->genl_sock, 0, -				ovs_dp_vport_multicast_group.id, PTR_ERR(reply)); -		goto exit_unlock; -	} +	err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid, +				      info->snd_seq, 0, OVS_VPORT_CMD_NEW); +	BUG_ON(err < 0);  	genl_notify(reply, genl_info_net(info), info->snd_portid,  		    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); +	rtnl_unlock(); +	return 0; + +exit_free: +	kfree_skb(reply);  exit_unlock:  	rtnl_unlock();  	return err; @@ -1771,6 +1779,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)  	if (IS_ERR(reply))  		goto exit_unlock; +	err = 0;  	ovs_dp_detach_port(vport);  	genl_notify(reply, genl_info_net(info), info->snd_portid,  |