Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);