Skip to content

Commit 68cb363

Browse files
committed
Merge branch 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull a percpu fix from Tejun Heo: "Fix for a percpu allocator bug where it could try to kfree() a memory region allocated using vmalloc(). The bug has been there for years now and is unlikely to have ever triggered given the size of struct pcpu_chunk. It's still theoretically possible and the fix is simple and safe enough, so the patch is marked with -stable" * 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
2 parents efb2b1d + 5a838c3 commit 68cb363

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/percpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ static struct pcpu_chunk *pcpu_alloc_chunk(void)
610610
chunk->map = pcpu_mem_zalloc(PCPU_DFL_MAP_ALLOC *
611611
sizeof(chunk->map[0]));
612612
if (!chunk->map) {
613-
kfree(chunk);
613+
pcpu_mem_free(chunk, pcpu_chunk_struct_size);
614614
return NULL;
615615
}
616616

0 commit comments

Comments
 (0)