output_group() has no business freeing the skb passed into it, but it was
doing so in case of allocation failure. Since execute_actions() would
also later free it, this was a serious error.
Thanks to Justin for pointing out the problem.
kfree_skb(skb);
}
+/* Never consumes 'skb'. Returns a port that 'skb' should be sent to, -1 if
+ * none. */
static int output_group(struct datapath *dp, __u16 group,
struct sk_buff *skb, gfp_t gfp)
{
continue;
if (prev_port != -1) {
struct sk_buff *clone = skb_clone(skb, gfp);
- if (!clone) {
- kfree_skb(skb);
+ if (!clone)
return -1;
- }
do_output(dp, clone, prev_port);
}
prev_port = p->port_no;