From: Tejun Heo Date: Mon, 8 Sep 2014 23:02:45 +0000 (+0900) Subject: percpu: fix locking regression in the failure path of pcpu_alloc() X-Git-Tag: fixes-against-v3.18-rc2~134^2~16 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23cb8981ed929b4dd48141401cd0fd31e0fa4ed0;p=pandora-kernel.git percpu: fix locking regression in the failure path of pcpu_alloc() While updating locking, b38d08f3181c ("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 Reported-by: Julia Lawall --- diff --git a/mm/percpu.c b/mm/percpu.c index 867efd38d879..af3dd2704efd 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -974,6 +974,7 @@ restart: 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; }