Hi Thomas,

On 10 July 2015 at 07:19, Thomas Graf <tg...@suug.ch> wrote:
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index ecfa530..05fe46b 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> @@ -1548,11 +1548,45 @@ static struct sw_flow_actions 
> *nla_alloc_flow_actions(int size, bool log)
>         return sfa;
>  }
>
> +static void ovs_nla_free_set_action(const struct nlattr *a)
> +{
> +       const struct nlattr *ovs_key = nla_data(a);
> +       struct ovs_tunnel_info *ovs_tun;
> +
> +       switch (nla_type(ovs_key)) {
> +       case OVS_KEY_ATTR_TUNNEL_INFO:
> +               ovs_tun = nla_data(ovs_key);
> +               dst_release((struct dst_entry *)ovs_tun->tun_dst);
> +               break;
> +       }
> +}
> +
> +void ovs_nla_free_flow_actions(struct sw_flow_actions *sf_acts)
> +{
> +       const struct nlattr *a;
> +       int rem;
> +
> +       nla_for_each_attr(a, sf_acts->actions, sf_acts->actions_len, rem) {
> +               switch (nla_type(a)) {
> +               case OVS_ACTION_ATTR_SET:
> +                       ovs_nla_free_set_action(a);
> +                       break;
> +               }
> +       }
> +
> +       kfree(sf_acts);
> +}

It doesn't look like flow_free() is using this new function to
properly free the actions. Also, some of the error cases that hit this
code have sf_acts=NULL.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to