aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_htb.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r--net/sched/sch_htb.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 3b3ff641b6d7..512df9a0a242 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -997,9 +997,17 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
997 struct htb_sched *q = qdisc_priv(sch); 997 struct htb_sched *q = qdisc_priv(sch);
998 struct nlattr *tb[TCA_HTB_INIT + 1]; 998 struct nlattr *tb[TCA_HTB_INIT + 1];
999 struct tc_htb_glob *gopt; 999 struct tc_htb_glob *gopt;
1000 int err;
1000 int i; 1001 int i;
1001 if (!opt || nla_parse_nested(tb, TCA_HTB_INIT, opt, NULL) || 1002
1002 tb[TCA_HTB_INIT] == NULL || 1003 if (!opt)
1004 return -EINVAL;
1005
1006 err = nla_parse_nested(tb, TCA_HTB_INIT, opt, NULL);
1007 if (err < 0)
1008 return err;
1009
1010 if (tb[TCA_HTB_INIT] == NULL ||
1003 nla_len(tb[TCA_HTB_INIT]) < sizeof(*gopt)) { 1011 nla_len(tb[TCA_HTB_INIT]) < sizeof(*gopt)) {
1004 printk(KERN_ERR "HTB: hey probably you have bad tc tool ?\n"); 1012 printk(KERN_ERR "HTB: hey probably you have bad tc tool ?\n");
1005 return -EINVAL; 1013 return -EINVAL;
@@ -1302,8 +1310,15 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
1302 struct tc_htb_opt *hopt; 1310 struct tc_htb_opt *hopt;
1303 1311
1304 /* extract all subattrs from opt attr */ 1312 /* extract all subattrs from opt attr */
1305 if (!opt || nla_parse_nested(tb, TCA_HTB_RTAB, opt, NULL) || 1313 if (!opt)
1306 tb[TCA_HTB_PARMS] == NULL || 1314 goto failure;
1315
1316 err = nla_parse_nested(tb, TCA_HTB_RTAB, opt, NULL);
1317 if (err < 0)
1318 goto failure;
1319
1320 err = -EINVAL;
1321 if (tb[TCA_HTB_PARMS] == NULL ||
1307 nla_len(tb[TCA_HTB_PARMS]) < sizeof(*hopt)) 1322 nla_len(tb[TCA_HTB_PARMS]) < sizeof(*hopt))
1308 goto failure; 1323 goto failure;
1309 1324