diff options
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r-- | net/sched/sch_cbq.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 5c8667ef4ba7..585f8a6ec7ec 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1382,9 +1382,13 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt) | |||
1382 | struct cbq_sched_data *q = qdisc_priv(sch); | 1382 | struct cbq_sched_data *q = qdisc_priv(sch); |
1383 | struct nlattr *tb[TCA_CBQ_MAX + 1]; | 1383 | struct nlattr *tb[TCA_CBQ_MAX + 1]; |
1384 | struct tc_ratespec *r; | 1384 | struct tc_ratespec *r; |
1385 | int err; | ||
1386 | |||
1387 | err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, NULL); | ||
1388 | if (err < 0) | ||
1389 | return err; | ||
1385 | 1390 | ||
1386 | if (nla_parse_nested(tb, TCA_CBQ_MAX, opt, NULL) < 0 || | 1391 | if (tb[TCA_CBQ_RTAB] == NULL || tb[TCA_CBQ_RATE] == NULL || |
1387 | tb[TCA_CBQ_RTAB] == NULL || tb[TCA_CBQ_RATE] == NULL || | ||
1388 | nla_len(tb[TCA_CBQ_RATE]) < sizeof(struct tc_ratespec)) | 1392 | nla_len(tb[TCA_CBQ_RATE]) < sizeof(struct tc_ratespec)) |
1389 | return -EINVAL; | 1393 | return -EINVAL; |
1390 | 1394 | ||
@@ -1764,9 +1768,13 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t | |||
1764 | struct cbq_class *parent; | 1768 | struct cbq_class *parent; |
1765 | struct qdisc_rate_table *rtab = NULL; | 1769 | struct qdisc_rate_table *rtab = NULL; |
1766 | 1770 | ||
1767 | if (opt==NULL || nla_parse_nested(tb, TCA_CBQ_MAX, opt, NULL)) | 1771 | if (opt == NULL) |
1768 | return -EINVAL; | 1772 | return -EINVAL; |
1769 | 1773 | ||
1774 | err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, NULL); | ||
1775 | if (err < 0) | ||
1776 | return err; | ||
1777 | |||
1770 | if (tb[TCA_CBQ_OVL_STRATEGY] && | 1778 | if (tb[TCA_CBQ_OVL_STRATEGY] && |
1771 | nla_len(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(struct tc_cbq_ovl)) | 1779 | nla_len(tb[TCA_CBQ_OVL_STRATEGY]) < sizeof(struct tc_cbq_ovl)) |
1772 | return -EINVAL; | 1780 | return -EINVAL; |