summaryrefslogtreecommitdiff
path: root/net/sched/sch_red.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_red.c')
-rw-r--r--net/sched/sch_red.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 6ce8da5aca0b..dcf6afc196f8 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -207,10 +207,15 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt)
struct nlattr *tb[TCA_RED_MAX + 1];
struct tc_red_qopt *ctl;
struct Qdisc *child = NULL;
+ int err;
- if (opt == NULL || nla_parse_nested(tb, TCA_RED_MAX, opt, NULL))
+ if (opt == NULL)
return -EINVAL;
+ err = nla_parse_nested(tb, TCA_RED_MAX, opt, NULL);
+ if (err < 0)
+ return err;
+
if (tb[TCA_RED_PARMS] == NULL ||
nla_len(tb[TCA_RED_PARMS]) < sizeof(*ctl) ||
tb[TCA_RED_STAB] == NULL ||