Commit 7838f2ce36b6ab5c13ef20b1857e3bbd567f1759

Authored by Thomas Graf
Committed by David S. Miller
1 parent a13861a28b

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/sched/sch_mqprio.c
... ... @@ -107,7 +107,7 @@
107 107 if (!netif_is_multiqueue(dev))
108 108 return -EOPNOTSUPP;
109 109  
110   - if (nla_len(opt) < sizeof(*qopt))
  110 + if (!opt || nla_len(opt) < sizeof(*qopt))
111 111 return -EINVAL;
112 112  
113 113 qopt = nla_data(opt);