Skip to content

Commit df0036d

Browse files
committed
kdb: Fix off by one error in kdb_cpu()
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> Cc: <stable@vger.kernel.org> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 1467559 commit df0036d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/debug/debug_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs,
604604
online_cpus)
605605
cpu_relax();
606606
if (!time_left)
607-
pr_crit("KGDB: Timed out waiting for secondary CPUs.\n");
607+
pr_crit("Timed out waiting for secondary CPUs.\n");
608608

609609
/*
610610
* At this point the primary processor is completely

kernel/debug/kdb/kdb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ static int kdb_cpu(int argc, const char **argv)
22562256
/*
22572257
* Validate cpunum
22582258
*/
2259-
if ((cpunum > NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
2259+
if ((cpunum >= CONFIG_NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)
22602260
return KDB_BADCPUNUM;
22612261

22622262
dbg_switch_cpu = cpunum;

0 commit comments

Comments
 (0)