Nathael Pajani 6eb68d6f3b tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver
I found a bug "by chance" in drivers/char/tty_io.c

I mean "by chance" because I was just reading the code of the
tty_find_polling_driver() to make a new tty_find_by_name() function.

In tty_find_polling_driver() the driver actually test "tty_line <=
p->num" while num refers to the number of struct tty_struct pointers
allocated for the p->ttys (p is a tty_driver), and tty_line is scanned
in a tty name, which can be for example ttyS2. Then tty_line equals 2.
And if p->num is 2, we have only p->ttys[0] and p->ttys[1], but no
p->ttys[2].

This is actually unharmful, for tty_find_polling_driver() is used only
in drivers/serial/kgdboc.c, and there's a test over there to find a
console with a matching index, which will never happen.

This is still a bug anyway.

Signed-off-by: Nathael Pajani <nathael.pajani@ed3l.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-03 17:29:04 -07:00
..
2009-09-24 07:21:03 -07:00
2010-08-16 23:44:49 -06:00
2010-08-10 13:47:40 -07:00
2010-05-17 03:06:12 +02:00
2010-08-10 13:47:40 -07:00
2010-08-12 08:43:29 -07:00
2009-12-10 22:55:36 +01:00
2010-08-10 13:47:45 -07:00
2010-08-10 13:47:43 -07:00
2010-08-10 13:47:39 -07:00
2010-08-11 08:59:23 -07:00
2010-05-27 09:12:50 -07:00
2010-08-18 08:35:47 -04:00
2010-05-27 09:12:50 -07:00
2010-08-10 13:47:40 -07:00
2010-08-23 18:17:21 -07:00
2010-08-10 13:47:44 -07:00
2010-08-10 13:47:40 -07:00
2010-08-10 13:47:43 -07:00
2009-10-14 17:36:53 +02:00
2010-01-04 12:31:21 -08:00
2010-08-10 13:47:44 -07:00