From: Michal Ostrowski 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 Signed-off-by: Andrew Morton --- drivers/char/rocket.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/char/rocket.c~rocketc-fix-ldisc-ref-count-handling drivers/char/rocket.c --- devel/drivers/char/rocket.c~rocketc-fix-ldisc-ref-count-handling 2005-07-14 16:44:57.000000000 -0700 +++ devel-akpm/drivers/char/rocket.c 2005-07-14 16:45:34.000000000 -0700 @@ -355,7 +355,7 @@ static void rp_do_receive(struct r_port ToRecv = space; if (ToRecv <= 0) - return; + goto done; /* * if status indicates there are errored characters in the @@ -437,6 +437,7 @@ static void rp_do_receive(struct r_port } /* 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); } _