diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2017-08-30 12:49:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-30 15:26:12 -0700 |
commit | e232657661242cc8a169595160847b3e66aa7056 (patch) | |
tree | 78fafb7299efac599ddc4c645ea41683b71f593d /net/sched/sch_sfq.c | |
parent | 634576a1844dba15bc5e6fc61d72f37e13a21615 (diff) | |
download | linux-stable-e232657661242cc8a169595160847b3e66aa7056.tar.gz linux-stable-e232657661242cc8a169595160847b3e66aa7056.tar.bz2 linux-stable-e232657661242cc8a169595160847b3e66aa7056.zip |
sch_sfq: fix null pointer dereference on init failure
Currently only a memory allocation failure can lead to this, so let's
initialize the timer first.
Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r-- | net/sched/sch_sfq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 82469ef9655e..fc69fc5956e9 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -716,13 +716,13 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt) int i; int err; + setup_deferrable_timer(&q->perturb_timer, sfq_perturbation, + (unsigned long)sch); + err = tcf_block_get(&q->block, &q->filter_list); if (err) return err; - setup_deferrable_timer(&q->perturb_timer, sfq_perturbation, - (unsigned long)sch); - for (i = 0; i < SFQ_MAX_DEPTH + 1; i++) { q->dep[i].next = i + SFQ_MAX_FLOWS; q->dep[i].prev = i + SFQ_MAX_FLOWS; |