diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-11 18:42:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-12 19:08:54 -0500 |
commit | 3f1e6d3fd37bd4f25e5b19f1c7ca21850426c33f (patch) | |
tree | 4a4c3e784973d34e3689e3fc6789ae3503db576c | |
parent | 72b36015ba43a3cca5303f5534d2c3e1899eae29 (diff) |
sch_gred: should not use GFP_KERNEL while holding a spinlock
gred_change_vq() is called under sch_tree_lock(sch).
This means a spinlock is held, and we are not allowed to sleep in this
context.
We might pre-allocate memory using GFP_KERNEL before taking spinlock,
but this is not suitable for stable material.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/sch_gred.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index b9493a09a870..6cd8ddfb512d 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c | |||
@@ -385,7 +385,7 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp, | |||
385 | struct gred_sched_data *q; | 385 | struct gred_sched_data *q; |
386 | 386 | ||
387 | if (table->tab[dp] == NULL) { | 387 | if (table->tab[dp] == NULL) { |
388 | table->tab[dp] = kzalloc(sizeof(*q), GFP_KERNEL); | 388 | table->tab[dp] = kzalloc(sizeof(*q), GFP_ATOMIC); |
389 | if (table->tab[dp] == NULL) | 389 | if (table->tab[dp] == NULL) |
390 | return -ENOMEM; | 390 | return -ENOMEM; |
391 | } | 391 | } |