]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
serial: fixup /proc/tty/driver/serial after proc_fops conversion
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 1 Apr 2009 21:30:04 +0000 (01:30 +0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Apr 2009 21:50:48 +0000 (14:50 -0700)
"struct tty_driver *" lies in m->private not in v which is
SEQ_TOKEN_START which is 1 which is enough to trigger NULL dereference
next line:

BUG: unable to handle kernel NULL pointer dereference at 000000ad
IP: [<c040d689>] uart_proc_show+0xe/0x2b0

Noticed by Linus.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/serial/serial_core.c

index bf3c0e32a334ad6903e48b928f8cb35862d2cec1..b0bb29d804ae43620c7d0ce1ba5c94cc9f11a28a 100644 (file)
@@ -1765,7 +1765,7 @@ static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i)
 
 static int uart_proc_show(struct seq_file *m, void *v)
 {
-       struct tty_driver *ttydrv = v;
+       struct tty_driver *ttydrv = m->private;
        struct uart_driver *drv = ttydrv->driver_state;
        int i;