[03/13] rocket.c: Fix ldisc ref count handling
From: Chris Wright
Date: Wed Aug 03 2005 - 01:59:30 EST
-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michal Ostrowski <mostrows@xxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
Signed-off-by: Chris Wright <chrisw@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/