lkml.org 
[lkml]   [2005]   [Aug]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 2 Aug 2005 23:50:18 -0700
FromChris Wright <>
Subject[03/13] rocket.c: Fix ldisc ref count handling
-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Michal Ostrowski <mostrows@watson.ibm.com>

If bailing out because there is nothing to receive in rp_do_receive(),
tty_ldisc_deref is not called.  Failure to do so increases the ref count=20
and causes release_dev() to hang since it can't get the ref count to 0.

Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/char/rocket.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
--- linux-2.6.12.3.orig/drivers/char/rocket.c	2005-07-28 11:17:01.000000000 -0700
+++ linux-2.6.12.3/drivers/char/rocket.c	2005-07-28 11:17:09.000000000 -0700
@@ -277,7 +277,7 @@
 		ToRecv = space;
 
 	if (ToRecv <= 0)
-		return;
+		goto done;
 
 	/*
 	 * if status indicates there are errored characters in the
@@ -359,6 +359,7 @@
 	}
 	/*  Push the data up to the tty layer */
 	ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count);
+done:
 	tty_ldisc_deref(ld);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-08-03 09:01    [from the cache]
©2003-2008