diff options
-rw-r--r-- | net/sched/act_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 0eb545bcb247..a306974e2fb4 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -296,10 +296,12 @@ err2: spin_lock_init(&p->tcfa_lock); /* user doesn't specify an index */ if (!index) { + idr_preload(GFP_KERNEL); spin_lock_bh(&idrinfo->lock); err = idr_alloc_ext(idr, NULL, &idr_index, 1, 0, - GFP_KERNEL); + GFP_ATOMIC); spin_unlock_bh(&idrinfo->lock); + idr_preload_end(); if (err) { err3: free_percpu(p->cpu_qstats); @@ -307,10 +309,12 @@ err3: } p->tcfa_index = idr_index; } else { + idr_preload(GFP_KERNEL); spin_lock_bh(&idrinfo->lock); err = idr_alloc_ext(idr, NULL, NULL, index, index + 1, - GFP_KERNEL); + GFP_ATOMIC); spin_unlock_bh(&idrinfo->lock); + idr_preload_end(); if (err) goto err3; p->tcfa_index = index; |