summaryrefslogtreecommitdiff
path: root/mm/percpu.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-10-29 11:45:04 +0300
committerTejun Heo <tj@kernel.org>2014-10-29 10:34:34 -0400
commit9f295664e2f2cdf53c596f74bcf3f644cae9fecc (patch)
tree31e986db37787dcc9758a68fd30261bd7adebd21 /mm/percpu.c
parentcac7f2429872d3733dc3f9915857b1691da2eb2f (diff)
downloadlwn-9f295664e2f2cdf53c596f74bcf3f644cae9fecc.tar.gz
lwn-9f295664e2f2cdf53c596f74bcf3f644cae9fecc.zip
percpu: off by one in BUG_ON()
The unit_map[] array has "nr_cpu_ids" number of elements. It's allocated a few lines earlier in the function. So this test should be >= instead of >. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu.c')
-rw-r--r--mm/percpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index 014bab65e0ff..d39e2f4e335c 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1591,7 +1591,7 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
if (cpu == NR_CPUS)
continue;
- PCPU_SETUP_BUG_ON(cpu > nr_cpu_ids);
+ PCPU_SETUP_BUG_ON(cpu >= nr_cpu_ids);
PCPU_SETUP_BUG_ON(!cpu_possible(cpu));
PCPU_SETUP_BUG_ON(unit_map[cpu] != UINT_MAX);