blob: bc3824546ba5ccee731e9c9fc6d09856807091ec [file] [log] [blame]
From stable-bounces@linux.kernel.org Thu Jul 14 16:54:10 2005
To: stable@kernel.org
From: akpm@osdl.org
Date: Thu, 14 Jul 2005 16:46:26 -0700
Cc: akpm@osdl.org, mostrows@watson.ibm.com
Subject: [patch] rocket.c: Fix ldisc ref count handling
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);
}