Skip to contentSkip to conversation

mqprio: Avoid panic if no options are provided

PATCH Applied Thomas Graf 2 participants 2 messages Dec 22, 2011 – Dec 23, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 net/sched/sch_mqprio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sched/sch_mqprio.c +1 -1
index f88256c..28de430 100644
@@ -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);
Signature · 1 line
1.7.7.4
maintainer Applied
#1 lore raw

From: Thomas Graf <[email protected]>
Date: Thu, 22 Dec 2011 13:05:07 +0100

Quoted 5 lines

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.

Applied.