Skip to content

Commit

Permalink
percpu: fix locking regression in the failure path of pcpu_alloc()
Browse files Browse the repository at this point in the history
While updating locking, b38d08f ("percpu: restructure locking")
broke pcpu_create_chunk() creation path in pcpu_alloc().  It returns
without releasing pcpu_alloc_mutex.  Fix it.

Signed-off-by: Tejun Heo <[email protected]>
Reported-by: Julia Lawall <[email protected]>
  • Loading branch information
htejun committed Sep 8, 2014
1 parent a34375e commit 23cb898
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
chunk = pcpu_create_chunk();
if (!chunk) {
mutex_unlock(&pcpu_alloc_mutex);
err = "failed to allocate new chunk";
goto fail;
}
Expand Down

0 comments on commit 23cb898

Please sign in to comment.