summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Beregalov2010-03-05 22:42:33 +0100
committerLinus Torvalds2010-03-06 20:26:28 +0100
commit03315b59165ee2049a4b903a1b0b8bf673d701fa (patch)
tree92513448a8af5e2a0b1f228310154fea14e44c2b
parentcris v32: typo in crisv32_arbiter_unwatch()? (diff)
downloadkernel-qcow2-linux-03315b59165ee2049a4b903a1b0b8bf673d701fa.tar.gz
kernel-qcow2-linux-03315b59165ee2049a4b903a1b0b8bf673d701fa.tar.xz
kernel-qcow2-linux-03315b59165ee2049a4b903a1b0b8bf673d701fa.zip
uml: line.c: avoid NULL pointer dereference
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>
-rw-r--r--arch/um/drivers/line.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index cf8a97f34518..64cda95f59ca 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -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;
}