summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>2019-08-07 01:45:40 +0300
committerDavid S. Miller <davem@davemloft.net>2019-08-09 08:00:24 +0300
commit51650d33b2771acd505068da669cf85cffac369a (patch)
treef974e43343186b5e7e39f066a56ac81ef3fa6f5d /net/sched
parentfe90689fed119cb55ff04e6a1df0817f0a3e9d32 (diff)
downloadlinux-51650d33b2771acd505068da669cf85cffac369a.tar.xz
net: sched: sch_taprio: fix memleak in error path for sched list parse
In error case, all entries should be freed from the sched list before deleting it. For simplicity use rcu way. Fixes: 5a781ccbd19e46 ("tc: Add support for configuring the taprio scheduler") Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_taprio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index c39db507ba3f..e25d414ae12f 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -1195,7 +1195,8 @@ unlock:
spin_unlock_bh(qdisc_lock(sch));
free_sched:
- kfree(new_admin);
+ if (new_admin)
+ call_rcu(&new_admin->rcu, taprio_free_sched_cb);
return err;
}