mqprio: Avoid panic if no options are provided
[ Upstream commit 7838f2ce36 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
7eac8f9de2
commit
477a897533
1 changed files with 1 additions and 1 deletions
|
|
@ -106,7 +106,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue