projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e92aa63
)
pkt_sched: sch_drr: Fix oops in drr_change_class.
author
Jarek Poplawski
<
[email protected]
>
Fri, 27 Feb 2009 10:42:38 +0000
(
02:42
-0800)
committer
David S. Miller
<
[email protected]
>
Fri, 27 Feb 2009 10:42:38 +0000
(
02:42
-0800)
drr_change_class lacks a check for NULL of tca[TCA_OPTIONS], so oops
is possible.
Reported-by: Denys Fedoryschenko <
[email protected]
>
Signed-off-by: Jarek Poplawski <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/sched/sch_drr.c
patch
|
blob
|
history
diff --git
a/net/sched/sch_drr.c
b/net/sched/sch_drr.c
index f6b4fa97df70e353b58ed04ba4a74f50f4c8fbcf..e36e94ab4e100a9b3d971c016734ec7f3f21ed2c 100644
(file)
--- 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;