aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-09-29 08:30:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-09-29 08:30:11 -0700
commit929675d58c5b4883050804f2b48de2293803862d (patch)
tree038755ae54815d19d12873dcb9ac4662c8345ccd /drivers
parent66120005e65eed8a05b14a36ab448bdec42f0d6b (diff)
parent0dca0fd2bfeb99738708d6c9117994ebf398e72c (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb: kgdboc,tty: Fix tty polling search to use name correctly kgdb, x86_64: fix PS CS SS registers in gdb serial kgdb, x86_64: gdb serial has BX and DX reversed kgdb, x86, arm, mips, powerpc: ignore user space single stepping kgdb: could not write to the last of valid memory with kgdb
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_io.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index daeb8f76697..e4dce870954 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -695,13 +695,23 @@ struct tty_driver *tty_find_polling_driver(char *name, int *line)
{
struct tty_driver *p, *res = NULL;
int tty_line = 0;
+ int len;
char *str;
+ for (str = name; *str; str++)
+ if ((*str >= '0' && *str <= '9') || *str == ',')
+ break;
+ if (!*str)
+ return NULL;
+
+ len = str - name;
+ tty_line = simple_strtoul(str, &str, 10);
+
mutex_lock(&tty_mutex);
/* Search through the tty devices to look for a match */
list_for_each_entry(p, &tty_drivers, tty_drivers) {
- str = name + strlen(p->name);
- tty_line = simple_strtoul(str, &str, 10);
+ if (strncmp(name, p->name, len) != 0)
+ continue;
if (*str == ',')
str++;
if (*str == '\0')