Skip to contentSkip to conversation

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

PATCH New Tejun Heo 1 participant 1 message Sep 8, 2014 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 540d6d8e.bX1TYtX2p4laJeSu%[email protected]

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.10.1409081121210.2406@hadrien

Tejun Heo

author maintainer
#2 lore raw

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

Quoted 1 line

From 23cb8981ed929b4dd48141401cd0fd31e0fa4ed0 Mon Sep 17 00:00:00 2001

From: Tejun Heo <[email protected]>
Date: Tue, 9 Sep 2014 08:02:45 +0900

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.

---
Applied to percpu/for-3.18.

Thanks a lot!

 mm/percpu.c | 1 +
 1 file changed, 1 insertion(+)
mm/percpu.c +1 -0
index 867efd3..af3dd27 100644
@@ -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;
 		}
Signature · 1 line
1.9.3