Skip to content

Commit

Permalink
[PATCH] rocket.c: Fix ldisc ref count handling
Browse files Browse the repository at this point in the history
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 <mostrows@watson.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Michal Ostrowski authored and Linus Torvalds committed Jul 15, 2005
1 parent 6f97933 commit a1287ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,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
Expand Down Expand Up @@ -437,6 +437,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);
}

Expand Down

0 comments on commit a1287ba

Please sign in to comment.