mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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: 6529eaba33 ("net: sched: introduce tcf block infractructure")
Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
634576a184
commit
e232657661
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue