Thread (6 messages) 6 messages, 3 authors, 2014-09-16

Re: [net-next PATCH 3/3] net: sched: cls_cgroup fix possible memory leak of 'new'

From: Cong Wang <hidden>
Date: 2014-09-16 03:04:38

On Mon, Sep 15, 2014 at 7:48 PM, John Fastabend
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 3b75487..52b7900 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -127,16 +127,16 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
        err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS],
                               cgroup_policy);
        if (err < 0)
-               return err;
+               goto errout;

        tcf_exts_init(&e, TCA_CGROUP_ACT, TCA_CGROUP_POLICE);
        err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr);
        if (err < 0)
-               return err;
+               goto errout;

        err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &t);
        if (err < 0)
-               return err;
+               goto errout;
I think you need to call tcf_exts_destroy() too after tcf_exts_validate(),
while you are on it. :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help