diff options
author | David S. Miller <davem@davemloft.net> | 2014-09-08 00:41:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-08 00:41:53 -0400 |
commit | eb84d6b60491a3ca3d90d62ee5346b007770d40d (patch) | |
tree | 22aadf9ada15e1ae5ba4c400aafab6f2541996e6 /net/openvswitch | |
parent | 97a13e5289baa96eaddd06e61d277457d837af3a (diff) | |
parent | d030671f3f261e528dc6e396a13f10859a74ae7c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/openvswitch')
-rw-r--r-- | net/openvswitch/datapath.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 7228ec3faf19..91d66b7e64ac 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -265,8 +265,11 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) | |||
265 | upcall.key = &key; | 265 | upcall.key = &key; |
266 | upcall.userdata = NULL; | 266 | upcall.userdata = NULL; |
267 | upcall.portid = ovs_vport_find_upcall_portid(p, skb); | 267 | upcall.portid = ovs_vport_find_upcall_portid(p, skb); |
268 | ovs_dp_upcall(dp, skb, &upcall); | 268 | error = ovs_dp_upcall(dp, skb, &upcall); |
269 | consume_skb(skb); | 269 | if (unlikely(error)) |
270 | kfree_skb(skb); | ||
271 | else | ||
272 | consume_skb(skb); | ||
270 | stats_counter = &stats->n_missed; | 273 | stats_counter = &stats->n_missed; |
271 | goto out; | 274 | goto out; |
272 | } | 275 | } |
@@ -404,7 +407,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, | |||
404 | { | 407 | { |
405 | struct ovs_header *upcall; | 408 | struct ovs_header *upcall; |
406 | struct sk_buff *nskb = NULL; | 409 | struct sk_buff *nskb = NULL; |
407 | struct sk_buff *user_skb; /* to be queued to userspace */ | 410 | struct sk_buff *user_skb = NULL; /* to be queued to userspace */ |
408 | struct nlattr *nla; | 411 | struct nlattr *nla; |
409 | struct genl_info info = { | 412 | struct genl_info info = { |
410 | .dst_sk = ovs_dp_get_net(dp)->genl_sock, | 413 | .dst_sk = ovs_dp_get_net(dp)->genl_sock, |
@@ -494,9 +497,11 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, | |||
494 | ((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len; | 497 | ((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len; |
495 | 498 | ||
496 | err = genlmsg_unicast(ovs_dp_get_net(dp), user_skb, upcall_info->portid); | 499 | err = genlmsg_unicast(ovs_dp_get_net(dp), user_skb, upcall_info->portid); |
500 | user_skb = NULL; | ||
497 | out: | 501 | out: |
498 | if (err) | 502 | if (err) |
499 | skb_tx_error(skb); | 503 | skb_tx_error(skb); |
504 | kfree_skb(user_skb); | ||
500 | kfree_skb(nskb); | 505 | kfree_skb(nskb); |
501 | return err; | 506 | return err; |
502 | } | 507 | } |