Skip to content

Commit

Permalink
mm, percpu: Make sure percpu_alloc early parameter has an argument
Browse files Browse the repository at this point in the history
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: [<ffffffff81391360>] strcmp+0x10/0x30

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Cyrill Gorcunov authored and htejun committed Dec 2, 2012
1 parent b4916cb commit 5479c78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5479c78

Please sign in to comment.