diff options
author | Thomas Graf <tgraf@redhat.com> | 2011-12-22 03:05:07 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-23 04:34:56 +0100 |
commit | 7838f2ce36b6ab5c13ef20b1857e3bbd567f1759 (patch) | |
tree | 4a84e53445817547adb299b25c54e613f76a8980 | |
parent | bridge: provide a mtu() method for fake_dst_ops (diff) | |
download | linux-7838f2ce36b6ab5c13ef20b1857e3bbd567f1759.tar.xz linux-7838f2ce36b6ab5c13ef20b1857e3bbd567f1759.zip |
mqprio: Avoid panic if no options are provided
Userspace may not provide TCA_OPTIONS, in fact tc currently does
so not do so if no arguments are specified on the command line.
Return EINVAL instead of panicing.
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/sch_mqprio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index f88256cbacbf..28de43092330 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -107,7 +107,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt) if (!netif_is_multiqueue(dev)) return -EOPNOTSUPP; - if (nla_len(opt) < sizeof(*qopt)) + if (!opt || nla_len(opt) < sizeof(*qopt)) return -EINVAL; qopt = nla_data(opt); |