diff --git a/[refs] b/[refs] index 39e22de15df9..91250cbde3b0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5d09d68335bb8422d5e7050c9f03f99ba6cfebd +refs/heads/master: 84667d4849b0e0a939a76f9f62d45fa3b4d59692 diff --git a/trunk/kernel/kgdb.c b/trunk/kernel/kgdb.c index 7d7014634022..29357a9ccfb2 100644 --- a/trunk/kernel/kgdb.c +++ b/trunk/kernel/kgdb.c @@ -541,12 +541,17 @@ static struct task_struct *getthread(struct pt_regs *regs, int tid) */ if (tid == 0 || tid == -1) tid = -atomic_read(&kgdb_active) - 2; - if (tid < 0) { + if (tid < -1 && tid > -NR_CPUS - 2) { if (kgdb_info[-tid - 2].task) return kgdb_info[-tid - 2].task; else return idle_task(-tid - 2); } + if (tid <= 0) { + printk(KERN_ERR "KGDB: Internal thread select error\n"); + dump_stack(); + return NULL; + } /* * find_task_by_pid_ns() does not take the tasklist lock anymore