]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] rocket.c: Fix ldisc ref count handling
authorMichal Ostrowski <mostrows@watson.ibm.com>
Thu, 14 Jul 2005 23:46:26 +0000 (16:46 -0700)
committerChris Wright <chrisw@osdl.org>
Fri, 5 Aug 2005 07:04:15 +0000 (00:04 -0700)
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

index 5bcbeb0cb9ae8988f09174821ad246d287a1d609..60882ec16984459d2e2877c7e98ca9d0a10eaa8d 100644 (file)
@@ -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);
 }