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>
This commit is contained in:
Stephen Hemminger 2008-11-25 21:13:31 -08:00 committed by David S. Miller
parent 0e991ec6a0
commit 71bcb09a57
6 changed files with 97 additions and 41 deletions

View file

@ -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;
}