summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_drr.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2009-02-27 02:42:38 -0800
committerDavid S. Miller <davem@davemloft.net>2009-02-27 02:42:38 -0800
commit1844f747947bb89d7f12cd3034548805113f764b (patch)
tree3d2cb21cf6a9aec7bfd1c0ad9f6320f7b2a8c1f6 /net/sched/sch_drr.c
parente92aa634a33739478958f4109d6bd35b36d13532 (diff)
downloadlinux-1844f747947bb89d7f12cd3034548805113f764b.tar.bz2
pkt_sched: sch_drr: Fix oops in drr_change_class.
drr_change_class lacks a check for NULL of tca[TCA_OPTIONS], so oops is possible. Reported-by: Denys Fedoryschenko <denys@visp.net.lb> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_drr.c')
-rw-r--r--net/sched/sch_drr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index f6b4fa97df70..e36e94ab4e10 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -66,11 +66,15 @@ static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
{
struct drr_sched *q = qdisc_priv(sch);
struct drr_class *cl = (struct drr_class *)*arg;
+ struct nlattr *opt = tca[TCA_OPTIONS];
struct nlattr *tb[TCA_DRR_MAX + 1];
u32 quantum;
int err;
- err = nla_parse_nested(tb, TCA_DRR_MAX, tca[TCA_OPTIONS], drr_policy);
+ if (!opt)
+ return -EINVAL;
+
+ err = nla_parse_nested(tb, TCA_DRR_MAX, opt, drr_policy);
if (err < 0)
return err;