mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Beregalov <a.beregalov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Beregalov <a.beregalov@gmail.com>,
	Jeff Dike <jdike@addtoit.com>
Subject: [PATCH] uml: line.c: avoid NULL pointer dereference
Date: Thu,  7 Jan 2010 18:57:03 +0300	[thread overview]
Message-ID: <1262879823-23438-1-git-send-email-a.beregalov@gmail.com> (raw)

Assign tty only if line is not NULL.

Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 arch/um/drivers/line.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index cf8a97f..4a46253 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -18,10 +18,12 @@ 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)
+	if (line) {
+		tty = line->tty;
 		chan_interrupt(&line->chan_list, &line->task, tty, irq);
+	}
 	return IRQ_HANDLED;
 }
 
-- 
1.6.6


                 reply	other threads:[~2010-01-07 15:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1262879823-23438-1-git-send-email-a.beregalov@gmail.com \
    --to=a.beregalov@gmail.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®