diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-04-06 12:34:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-06 17:36:33 -0400 |
commit | 0e0fd7d73ed130583dca16405b029f56bf65109f (patch) | |
tree | d32a3aafc1abc6f86819bc52773500b9205c2136 /drivers/char/moxa.c | |
parent | bbb8e6bf10c5c3c9c70a94aa26cb27f95f10dee5 (diff) |
tty: moxa, fix refcounting in moxa_poll_port
There is missing tty_kref_put on some paths in moxa_poll_port,
although the reference is always taken. Fix it.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Reported-by: Jan 'Yenya' Kasprzak <kas@fi.muni.cz>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/moxa.c')
-rw-r--r-- | drivers/char/moxa.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index 8b0da97d5293..4a4cab73d0be 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c | |||
@@ -1486,11 +1486,11 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle, | |||
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | if (!handle) /* nothing else to do */ | 1488 | if (!handle) /* nothing else to do */ |
1489 | return 0; | 1489 | goto put; |
1490 | 1490 | ||
1491 | intr = readw(ip); /* port irq status */ | 1491 | intr = readw(ip); /* port irq status */ |
1492 | if (intr == 0) | 1492 | if (intr == 0) |
1493 | return 0; | 1493 | goto put; |
1494 | 1494 | ||
1495 | writew(0, ip); /* ACK port */ | 1495 | writew(0, ip); /* ACK port */ |
1496 | ofsAddr = p->tableAddr; | 1496 | ofsAddr = p->tableAddr; |
@@ -1499,16 +1499,17 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle, | |||
1499 | ofsAddr + HostStat); | 1499 | ofsAddr + HostStat); |
1500 | 1500 | ||
1501 | if (!inited) | 1501 | if (!inited) |
1502 | return 0; | 1502 | goto put; |
1503 | 1503 | ||
1504 | if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */ | 1504 | if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */ |
1505 | tty_insert_flip_char(tty, 0, TTY_BREAK); | 1505 | tty_insert_flip_char(tty, 0, TTY_BREAK); |
1506 | tty_schedule_flip(tty); | 1506 | tty_schedule_flip(tty); |
1507 | } | 1507 | } |
1508 | tty_kref_put(tty); | ||
1509 | 1508 | ||
1510 | if (intr & IntrLine) | 1509 | if (intr & IntrLine) |
1511 | moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state); | 1510 | moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state); |
1511 | put: | ||
1512 | tty_kref_put(tty); | ||
1512 | 1513 | ||
1513 | return 0; | 1514 | return 0; |
1514 | } | 1515 | } |