tree c16aef43738ee0bf32e3514065ad394d04980900
parent 6f97933d0fd13920d7d53b6e0107bb674b3a1f0b
author Michal Ostrowski <[EMAIL PROTECTED]> Fri, 15 Jul 2005 17:56:33 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Fri, 15 Jul 2005 23:54:51 -0700

[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
and causes release_dev() to hang since it can't get the ref count to 0.

Signed-off-by: Michal Ostrowski <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/char/rocket.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -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);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to