Skip to contentSkip to conversation

mm, percpu: Make sure percpu_alloc early parameter has an argument

PATCH Applied Cyrill Gorcunov 2 participants 2 messages Nov 24, 2012 – Dec 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm, percpu: Make sure percpu_alloc early parameter has an argument

Otherwise we are getting a nil dereference

 | [    0.000000] BUG: unable to handle kernel NULL pointer dereference at           (null)
 | [    0.000000] IP: [<ffffffff81391360>] strcmp+0x10/0x30
---
 mm/percpu.c |    3 +++
 1 file changed, 3 insertions(+)
mm/percpu.c +3 -0
Index: linux-2.6.git/mm/percpu.c
===================================================================
@@ -1380,6 +1380,9 @@ enum pcpu_fc pcpu_chosen_fc __initdata =
 
 static int __init percpu_alloc_setup(char *str)
 {
+	if (!str)
+		return -EINVAL;
+
 	if (0)
 		/* nada */;
 #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK
maintainer Applied
#1 lore raw
Quoted 6 lines · Cyrill Gorcunov

Otherwise we are getting a nil dereference

 | [    0.000000] BUG: unable to handle kernel NULL pointer dereference at           (null)
 | [    0.000000] IP: [<ffffffff81391360>] strcmp+0x10/0x30

Applied to percpu/for-3.8. Thanks!

Signature · 1 line
tejun