net_sched: sfq: fix mem alloc error recovery
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 4 Jan 2012 06:22:24 +0000 (06:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jan 2012 19:12:48 +0000 (14:12 -0500)
commitbd16a6cce2a7f169b559abc5672fd2c66e91fb36
treea4407fbec170a8ed06bf52a6667d26c4fdd2a124
parent6cfb5e759d47f037cbd0953ec2c3ceb220ed9e96
net_sched: sfq: fix mem alloc error recovery

Since commit 817fb15dfd98 (net_sched: sfq: allow divisor to be a
parameter), we can leave perturbation timer armed if a memory allocation
error aborts sfq_init().

Memory containing active struct timer_list is freed and kernel can
crash.

Call sfq_destroy() from sfq_init() to properly dismantle qdisc.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_sfq.c