Commit 01e866bf authored by Vlad Buslov's avatar Vlad Buslov Committed by David S. Miller

net: sched: act_ife: fix memory leak in ife init

Free params if tcf_idr_check_alloc() returned error.

Fixes: 0190c1d4 ("net: sched: atomically check-allocate action")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dce04f1
......@@ -485,8 +485,10 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
return -ENOMEM;
err = tcf_idr_check_alloc(tn, &parm->index, a, bind);
if (err < 0)
if (err < 0) {
kfree(p);
return err;
}
exists = err;
if (exists && bind) {
kfree(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment