net_sched: act_bpf: remove unnecessary copy
authorAlexei Starovoitov <ast@plumgrid.com>
Wed, 26 Aug 2015 03:06:32 +0000 (20:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Aug 2015 18:01:44 +0000 (11:01 -0700)
Fix harmless typo and avoid unnecessary copy of empty 'prog' into
unused 'strcut tcf_bpf_cfg old'.

Fixes: f4eaed28c783 ("act_bpf: fix memory leaks when replacing bpf programs")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_bpf.c

index 1b97dabc621a59f3772738c3345e6f1bb5185958..458cf647e698ae46ec8f394fa6c94e0d77345d68 100644 (file)
@@ -327,7 +327,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
        prog = to_bpf(act);
        spin_lock_bh(&prog->tcf_lock);
 
-       if (ret != ACT_P_CREATED)
+       if (res != ACT_P_CREATED)
                tcf_bpf_prog_fill_cfg(prog, &old);
 
        prog->bpf_ops = cfg.bpf_ops;