Commit dce783c5 authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu

Blackfin arch: add BUG_ON() checks to make sure we dont overflow the cplb tables

Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 86249911
...@@ -420,8 +420,17 @@ void __init generate_cplb_tables_cpu(unsigned int cpu) ...@@ -420,8 +420,17 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
} }
} }
/* close tables */ /* make sure we locked the kernel start */
BUG_ON(cplb.init_i.pos < 2 + cplb_data[ZERO_P].valid);
BUG_ON(cplb.init_d.pos < 1 + cplb_data[ZERO_P].valid + cplb_data[L1D_MEM].valid);
/* make sure we didnt overflow the table */
BUG_ON(cplb.init_i.size <= cplb.init_i.pos);
BUG_ON(cplb.init_d.size <= cplb.init_d.pos);
BUG_ON(cplb.switch_i.size <= cplb.switch_i.pos);
BUG_ON(cplb.switch_d.size <= cplb.switch_d.pos);
/* close tables */
close_cplbtab(&cplb.init_i); close_cplbtab(&cplb.init_i);
close_cplbtab(&cplb.init_d); close_cplbtab(&cplb.init_d);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment