uml: line.c: avoid NULL pointer dereference
authorAlexander Beregalov <a.beregalov@gmail.com>
Fri, 5 Mar 2010 21:42:33 +0000 (13:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:28 +0000 (11:26 -0800)
Assign tty only if line is not NULL.

[akpm@linux-foundation.org: simplification]
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/line.c

index cf8a97f..64cda95 100644 (file)
@@ -18,10 +18,10 @@ static irqreturn_t line_interrupt(int irq, void *data)
 {
        struct chan *chan = data;
        struct line *line = chan->line;
-       struct tty_struct *tty = line->tty;
+       struct tty_struct *tty;
 
        if (line)
-               chan_interrupt(&line->chan_list, &line->task, tty, irq);
+               chan_interrupt(&line->chan_list, &line->task, line->tty, irq);
        return IRQ_HANDLED;
 }