tty: Fix oops when scanning the polling list for kgdb
authorAlan Cox <alan@linux.intel.com>
Thu, 11 Jun 2009 11:46:41 +0000 (12:46 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jun 2009 15:51:01 +0000 (08:51 -0700)
commit5f0878acba7db24323f5ba4055ec9a96895bb150
tree4e92e6a29ea537b62276d0902b499c3ee6779dd8
parent620df3c0a5b70656c4de6049825de214f108218e
tty: Fix oops when scanning the polling list for kgdb

Costantino Leandro found a bug in tty_find_polling_driver and provided a
patch that fixed the crash but not the underlying bug. This fixes the
underlying bug where the list walk corrupts the values it is using on a
match but then reuses them if the open fails.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tty_io.c