From: Eric Dumazet Date: Sun, 11 Dec 2011 23:42:53 +0000 (+0000) Subject: sch_gred: should not use GFP_KERNEL while holding a spinlock X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3f1e6d3fd37b;p=mv-sheeva.git 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index b9493a09a87..6cd8ddfb512 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, struct gred_sched_data *q; if (table->tab[dp] == NULL) { - table->tab[dp] = kzalloc(sizeof(*q), GFP_KERNEL); + table->tab[dp] = kzalloc(sizeof(*q), GFP_ATOMIC); if (table->tab[dp] == NULL) return -ENOMEM; }