From: Cyrill Gorcunov Date: Sat, 24 Nov 2012 21:17:13 +0000 (+0400) Subject: mm, percpu: Make sure percpu_alloc early parameter has an argument X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5479c78ac6f688ea5ea8c49b44cf90ea87b63931;p=linux-beck.git mm, percpu: Make sure percpu_alloc early parameter has an argument Otherwise we are getting a nil dereference if percpu_alloc kernel boot argument is specified without value. | [ 0.000000] BUG: unable to handle kernel NULL pointer dereference at (null) | [ 0.000000] IP: [] strcmp+0x10/0x30 Signed-off-by: Cyrill Gorcunov Signed-off-by: Tejun Heo --- diff --git a/mm/percpu.c b/mm/percpu.c index ec2589616e7d..8c8e08f3a692 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1380,6 +1380,9 @@ enum pcpu_fc pcpu_chosen_fc __initdata = PCPU_FC_AUTO; static int __init percpu_alloc_setup(char *str) { + if (!str) + return -EINVAL; + if (0) /* nada */; #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK