8250: Fix oops from setserial
commit5c652d98415a927dec43a1267d3e64a40dbb6936
authorAlan Cox <alan@linux.intel.com>
Thu, 28 May 2009 13:01:35 +0000 (28 14:01 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:40:29 +0000 (2 16:40 -0700)
tree6eeb886c8a31d364dd1c2fc972381acddc6814ed
parent546eeb68fce4648c014679b2a57e4e7f8a6d4463
8250: Fix oops from setserial

commit b8e7e40abeac49644fec4a4f52ffe74c7b05eca0 upstream.

If you setserial a port which has never been initialised we change the type
but don't update the I/O method pointers. The same problem is true if you
change the io type of a port - but nobody ever does that so nobody noticed!

Remember the old type and when attaching if the type has changed reload the
port accessor pointers. We can't do it blindly as some 8250 drivers load custom
accessors and we must not stomp those.

Tested-by: Victor Seryodkin <vvscore@gmail.com>
Closes-bug: #13367
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/serial/8250.c