Skip to contentSkip to conversation

drivers/char/mxser.c: Fix reference counting

PATCH In review Jan Kasprzak 2 participants 3 messages Mar 16, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/char/mxser.c: Fix reference counting

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.

---
 drivers/char/mxser.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/char/mxser.c +1 -0
index 402c9f2..de6f565 100644
@@ -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)
Signature · 6 lines
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/ |
Quoted 2 lines
Quoted 2 lines

If you find yourself arguing with Alan Cox, you’re _probably_ wrong. <<
--James Morris in "How and Why You Should Become a Kernel Hacker" <<

#1 lore raw
Quoted 3 lines · Jan Kasprzak

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.

I was faster :P:
http://lkml.org/lkml/2009/3/16/159

#2 lore raw

Jiri Slaby wrote:
: On 16.3.2009 16:48, Jan Kasprzak wrote:
: >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.
:
: I was faster :P:
: http://lkml.org/lkml/2009/3/16/159

OK, sorry for not checking out lkml first :-)

-Yenya

Signature · 3 lines
| 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/ |
Quoted 2 lines
Quoted 2 lines

If you find yourself arguing with Alan Cox, you’re _probably_ wrong. <<
--James Morris in "How and Why You Should Become a Kernel Hacker" <<