percpu: fix locking regression in the failure path of pcpu_alloc()
[firefly-linux-kernel-4.4.55.git] / mm / percpu.c
index 867efd38d879111ff162f456e51b1c6fdfd163e1..af3dd2704efd82b78759c0278e4ffd7205abe2db 100644 (file)
@@ -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;
                }