diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-26 08:13:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-26 08:13:31 +0300 |
commit | 71bcb09a57894fa35591ce93dd972065eeecb63a (patch) | |
tree | 50ca8a43125f0aa89f1444928a209420754a79f3 /net/sched/sch_api.c | |
parent | 0e991ec6a0340916d3f29bd5dcb35299069e7226 (diff) | |
download | linux-71bcb09a57894fa35591ce93dd972065eeecb63a.tar.xz |
tc: check for errors in gen_rate_estimator creation
The functions gen_new_estimator and gen_replace_estimator can return
errors, but they were being ignored.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 3fcfd4ef11d1..f859dd5fabf4 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -880,9 +880,12 @@ static int qdisc_change(struct Qdisc *sch, struct nlattr **tca) sch->stab = stab; if (tca[TCA_RATE]) + /* NB: ignores errors from replace_estimator + because change can't be undone. */ gen_replace_estimator(&sch->bstats, &sch->rate_est, - qdisc_root_sleeping_lock(sch), - tca[TCA_RATE]); + qdisc_root_sleeping_lock(sch), + tca[TCA_RATE]); + return 0; } |