We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 287e363 + 7b42f40 commit 9413336Copy full SHA for 9413336
1 file changed
kernel/workqueue.c
@@ -4610,8 +4610,12 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)
4610
4611
enomem:
4612
if (wq->cpu_pwq) {
4613
- for_each_possible_cpu(cpu)
4614
- kfree(*per_cpu_ptr(wq->cpu_pwq, cpu));
+ for_each_possible_cpu(cpu) {
+ struct pool_workqueue *pwq = *per_cpu_ptr(wq->cpu_pwq, cpu);
4615
+
4616
+ if (pwq)
4617
+ kmem_cache_free(pwq_cache, pwq);
4618
+ }
4619
free_percpu(wq->cpu_pwq);
4620
wq->cpu_pwq = NULL;
4621
}
0 commit comments