aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2011-12-21 21:05:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-06 17:14:08 -0500
commit477a897533f9ab9a6ebb6eedfa9ca3760caa94b2 (patch)
treec7b870384e18ec15602a765f5037c8cd4186ee35 /net
parent7eac8f9de24674cc55ee9797d05447bbfbdf1a96 (diff)
mqprio: Avoid panic if no options are provided
[ Upstream commit 7838f2ce36b6ab5c13ef20b1857e3bbd567f1759 ] 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>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_mqprio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index ea17cbed29e..59b26b8ff4b 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -106,7 +106,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
106 if (!netif_is_multiqueue(dev)) 106 if (!netif_is_multiqueue(dev))
107 return -EOPNOTSUPP; 107 return -EOPNOTSUPP;
108 108
109 if (nla_len(opt) < sizeof(*qopt)) 109 if (!opt || nla_len(opt) < sizeof(*qopt))
110 return -EINVAL; 110 return -EINVAL;
111 111
112 qopt = nla_data(opt); 112 qopt = nla_data(opt);