[PATCH] drivers/char/mxser.c: Fix reference counting

From: Jan Kasprzak
Date: Mon Mar 16 2009 - 11:48:41 EST


Hello,

In drivers/char/mxser.c:mxser_check_modem_status() there is a call
to tty_port_tty_get without a corresponding tty_put() call. This causes
the device to return -EIO on the second open(2) call.

Signed-off-by: Jan "Yenya" Kasprzak <kas@xxxxxxxxxx>
Cc: Jiri Slaby <jirislaby@xxxxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
---
drivers/char/mxser.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 402c9f2..de6f565 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -848,6 +848,7 @@ static void mxser_check_modem_status(struct tty_struct *tty,
}
}
}
+ tty_kref_put(tty);
}

static int mxser_startup(struct tty_struct *tty)
--
1.5.3.3

--
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/ Journal: http://www.fi.muni.cz/~kas/blog/ |
>> If you find yourself arguing with Alan Cox, youâre _probably_ wrong. <<
>> --James Morris in "How and Why You Should Become a Kernel Hacker" <<
--
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/