From ea82e9ef2ce64db89db3a46c8fbc207f941fe74a Mon Sep 17 00:00:00 2001 From: Jan Stoess Date: Tue, 4 Dec 2007 12:20:10 +0100 Subject: [PATCH] - Limit cpu no input to realistic values --- kernel/kdb/generic/linear_ptab_dump.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/kdb/generic/linear_ptab_dump.cc b/kernel/kdb/generic/linear_ptab_dump.cc index 5ecdaadf..0573de2f 100644 --- a/kernel/kdb/generic/linear_ptab_dump.cc +++ b/kernel/kdb/generic/linear_ptab_dump.cc @@ -77,10 +77,11 @@ CMD(cmd_dump_ptab, cg) space = get_space ("Space"); size = pgent_t::size_max; - word_t cpuid = get_dec("CPU id", get_current_cpu(), NULL); + word_t cpu = get_dec("CPU id", get_current_cpu(), NULL); + if (cpu >= CONFIG_SMP_MAX_CPUS) cpu = get_current_cpu(); get_ptab_dump_ranges (&vaddr, &num, &max_size); - pg = space->pgent (page_table_index (pgent_t::size_max, vaddr), cpuid); + pg = space->pgent (page_table_index (pgent_t::size_max, vaddr), cpu); if (!pg) {