Commit 23cb8981 authored by Tejun Heo's avatar Tejun Heo

percpu: fix locking regression in the failure path of pcpu_alloc()

While updating locking, b38d08f3 ("percpu: restructure locking")
broke pcpu_create_chunk() creation path in pcpu_alloc().  It returns
without releasing pcpu_alloc_mutex.  Fix it.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
parent a34375ef
...@@ -974,6 +974,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, ...@@ -974,6 +974,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
if (list_empty(&pcpu_slot[pcpu_nr_slots - 1])) { if (list_empty(&pcpu_slot[pcpu_nr_slots - 1])) {
chunk = pcpu_create_chunk(); chunk = pcpu_create_chunk();
if (!chunk) { if (!chunk) {
mutex_unlock(&pcpu_alloc_mutex);
err = "failed to allocate new chunk"; err = "failed to allocate new chunk";
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment