Skip to content
Snippets Groups Projects
Commit 7838f2ce authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller
Browse files

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: default avatarThomas Graf <tgraf@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a13861a2
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment