Commit 51650d33 authored by Ivan Khoronzhuk's avatar Ivan Khoronzhuk Committed by David S. Miller

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: 5a781ccb ("tc: Add support for configuring the taprio scheduler")
Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe90689f
...@@ -1195,7 +1195,8 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, ...@@ -1195,7 +1195,8 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
spin_unlock_bh(qdisc_lock(sch)); spin_unlock_bh(qdisc_lock(sch));
free_sched: free_sched:
kfree(new_admin); if (new_admin)
call_rcu(&new_admin->rcu, taprio_free_sched_cb);
return err; return err;
} }
......
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