aboutsummaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-10 09:25:29 +0200
committerIngo Molnar <mingo@elte.hu>2008-10-10 09:25:29 +0200
commit8eb95f28f66b1a5461fdbcc9a1ee9068fb2cf2b6 (patch)
treee42d0e004b07f86d38de930fc163f3ca7d121f9c /drivers/char
parentd7451fca18e2ec62641ae4bbfe946069f13765a3 (diff)
parent3fa8749e584b55f1180411ab1b51117190bac1e5 (diff)
Merge commit 'v2.6.27' into timers/hpet
Diffstat (limited to 'drivers/char')
-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')