[PATCH] rocket.c: Fix ldisc ref count handling

From: Michal Ostrowski
Date: Thu Jul 14 2005 - 09:38:47 EST


--Signature_Thu__14_Jul_2005_10_36_47_-0400_nkGmpsO9ak_YCoCi
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

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@xxxxxxxxxxxxxx>

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

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=20
ToRecv =3D space;
=20
if (ToRecv <=3D 0)
- return;
+ goto done;
=20
/*
* if status indicates there are errored characters in the
@@ -437,6 +437,7 @@ static void rp_do_receive(struct r_port=20
}
/* 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);
}
=20

--Signature_Thu__14_Jul_2005_10_36_47_-0400_nkGmpsO9ak_YCoCi
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFC1nh/DMDCqU5zPMARAr9FAJ0WoEZcIiq9stwRf4g9TMwNTu/lHgCdHZ/+
uEgBJK1jhjoWvmvQFf4dnt8=
=gjDq
-----END PGP SIGNATURE-----

--Signature_Thu__14_Jul_2005_10_36_47_-0400_nkGmpsO9ak_YCoCi--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/