提交 833bb304 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

serial: fixup /proc/tty/driver/serial after proc_fops conversion

"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: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 8b53ef33
...@@ -1765,7 +1765,7 @@ static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i) ...@@ -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) 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; struct uart_driver *drv = ttydrv->driver_state;
int i; int i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册