diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-10 03:25:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-10 03:25:29 -0400 |
commit | 8eb95f28f66b1a5461fdbcc9a1ee9068fb2cf2b6 (patch) | |
tree | e42d0e004b07f86d38de930fc163f3ca7d121f9c /drivers/char | |
parent | d7451fca18e2ec62641ae4bbfe946069f13765a3 (diff) | |
parent | 3fa8749e584b55f1180411ab1b51117190bac1e5 (diff) |
Merge commit 'v2.6.27' into timers/hpet
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tty_io.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index daeb8f766971..e4dce8709541 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) | |||
695 | { | 695 | { |
696 | struct tty_driver *p, *res = NULL; | 696 | struct tty_driver *p, *res = NULL; |
697 | int tty_line = 0; | 697 | int tty_line = 0; |
698 | int len; | ||
698 | char *str; | 699 | char *str; |
699 | 700 | ||
701 | for (str = name; *str; str++) | ||
702 | if ((*str >= '0' && *str <= '9') || *str == ',') | ||
703 | break; | ||
704 | if (!*str) | ||
705 | return NULL; | ||
706 | |||
707 | len = str - name; | ||
708 | tty_line = simple_strtoul(str, &str, 10); | ||
709 | |||
700 | mutex_lock(&tty_mutex); | 710 | mutex_lock(&tty_mutex); |
701 | /* Search through the tty devices to look for a match */ | 711 | /* Search through the tty devices to look for a match */ |
702 | list_for_each_entry(p, &tty_drivers, tty_drivers) { | 712 | list_for_each_entry(p, &tty_drivers, tty_drivers) { |
703 | str = name + strlen(p->name); | 713 | if (strncmp(name, p->name, len) != 0) |
704 | tty_line = simple_strtoul(str, &str, 10); | 714 | continue; |
705 | if (*str == ',') | 715 | if (*str == ',') |
706 | str++; | 716 | str++; |
707 | if (*str == '\0') | 717 | if (*str == '\0') |