mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 02:36:21 +00:00
kdb: Fix off by one error in kdb_cpu()
commit df0036d117e6c9df36324e517728e33543065f9a upstream. There was a follow on replacement patch against the prior "kgdb: Timeout if secondary CPUs ignore the roundup". See: https://lkml.org/lkml/2015/1/7/442 This patch is the delta vs the patch that was committed upstream: * Fix an off-by-one error in kdb_cpu(). * Replace NR_CPUS with CONFIG_NR_CPUS to tell checkpatch that we really want a static limit. * Removed the "KGDB: " prefix from the pr_crit() in debug_core.c (kgdb-next contains a patch which introduced pr_fmt() to this file to the tag will now be applied automatically). Cc: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8b29b33d2a
commit
244e7e5394
@ -604,7 +604,7 @@ return_normal:
|
||||
online_cpus)
|
||||
cpu_relax();
|
||||
if (!time_left)
|
||||
pr_crit("KGDB: Timed out waiting for secondary CPUs.\n");
|
||||
pr_crit("Timed out waiting for secondary CPUs.\n");
|
||||
|
||||
/*
|
||||
* At this point the primary processor is completely
|
||||
|
@ -2256,7 +2256,7 @@ static int kdb_cpu(int argc, const char **argv)
|
||||
/*
|
||||
* Validate cpunum
|
||||
*/
|
||||
if ((cpunum > NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
|
||||
if ((cpunum >= CONFIG_NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
|
||||
return KDB_BADCPUNUM;
|
||||
|
||||
dbg_switch_cpu = cpunum;
|
||||
|
Loading…
x
Reference in New Issue
Block a user