From: Thomas Graf Date: Thu, 22 Dec 2011 02:05:07 +0000 (+0000) Subject: mqprio: Avoid panic if no options are provided X-Git-Tag: v4.14-rc1~13128^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7838f2ce36b6ab5c13ef20b1857e3bbd567f1759;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index f88256cbacbf..28de43092330 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -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);