All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org, cabbey@us.ibm.com
Subject: [patch] HVSI hangup oops
Date: Thu, 21 Oct 2004 16:27:15 +0000	[thread overview]
Message-ID: <1098376034.12020.34.camel@localhost> (raw)

Hi Linus, testing revealed that the HVSI driver could oops if carrier
detect dropped mid-data transfer. Please apply this fix.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

-- 
Hollis Blanchard
IBM Linux Technology Center

--- drivers/char/hvsi.c.orig	2004-10-11 11:36:36.000000000 -0500
+++ drivers/char/hvsi.c	2004-10-11 13:24:13.000000000 -0500
@@ -927,11 +927,17 @@ static void hvsi_close(struct tty_struct
 static void hvsi_hangup(struct tty_struct *tty)
 {
 	struct hvsi_struct *hp = tty->driver_data;
+	unsigned long flags;
 
 	pr_debug("%s\n", __FUNCTION__);
 
+	spin_lock_irqsave(&hp->lock, flags);
+
 	hp->count = 0;
+	hp->n_outbuf = 0;
 	hp->tty = NULL;
+
+	spin_unlock_irqrestore(&hp->lock, flags);
 }
 
 /* called with hp->lock held */



                 reply	other threads:[~2004-10-21 21:56 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=1098376034.12020.34.camel@localhost \
    --to=hollisb@us.ibm.com \
    --cc=cabbey@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.