]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: initialize timer earlier in red_init()
authorCong Wang <xiyou.wangcong@gmail.com>
Sat, 25 Jul 2020 20:17:07 +0000 (13:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jul 2020 00:41:23 +0000 (17:41 -0700)
commitc04f1468056da72e18e3eadaae69c97a85f8b879
treedb5756d038d46cb1484d2b86e3b998b0614d23f0
parent76e2d3f765ec7071f5ed49d1889490a22416b286
net_sched: initialize timer earlier in red_init()

When red_init() fails, red_destroy() is called to clean up.
If the timer is not initialized yet, del_timer_sync() will
complain. So we have to move timer_setup() before any failure.

Reported-and-tested-by: syzbot+6e95a4fabf88dc217145@syzkaller.appspotmail.com
Fixes: 9daf5dba870b ("net: sched: sch_red: Add qevents "early_drop" and "mark"")
Cc: Petr Machata <petrm@mellanox.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_red.c