提交 01e866bf 编写于 作者: V Vlad Buslov 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NVlad Buslov <vladbu@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册