From: Michal Ostrowski Date: Thu, 14 Jul 2005 23:46:26 +0000 (-0700) Subject: [PATCH] rocket.c: Fix ldisc ref count handling X-Git-Tag: v2.6.12.4~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0b02eec6f8371d993c4aca134d728d3510f7c8a;p=thirdparty%2Fkernel%2Fstable.git [PATCH] rocket.c: Fix ldisc ref count handling 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 Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 5bcbeb0cb9ae8..60882ec169844 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -277,7 +277,7 @@ static void rp_do_receive(struct r_port *info, ToRecv = space; if (ToRecv <= 0) - return; + goto done; /* * if status indicates there are errored characters in the @@ -359,6 +359,7 @@ static void rp_do_receive(struct r_port *info, } /* 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); }