Skip to content

Commit

Permalink
uml: line.c: avoid NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alexb0 authored and torvalds committed Mar 6, 2010
1 parent be14945 commit 03315b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 03315b5

Please sign in to comment.