From 5122397056821d3f5007602ab91ec0acce916cc5 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 26 Aug 2011 11:26:00 +0100 Subject: [PATCH] --- yaml --- r: 267326 b: refs/heads/master c: da4e40e271a30ecf8b87f70619cca93c25ed0199 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/tty/serial/mrst_max3110.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6d4ba473cd5f..9be4cb383fc3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 51808f051ede81865b7af351d6c230a1ac244a22 +refs/heads/master: da4e40e271a30ecf8b87f70619cca93c25ed0199 diff --git a/trunk/drivers/tty/serial/mrst_max3110.c b/trunk/drivers/tty/serial/mrst_max3110.c index 42aa43934b20..1aa2c3cd2146 100644 --- a/trunk/drivers/tty/serial/mrst_max3110.c +++ b/trunk/drivers/tty/serial/mrst_max3110.c @@ -347,7 +347,7 @@ receive_chars(struct uart_max3110 *max, unsigned short *str, int len) if (!port->state) return 0; - tty = port->state->port.tty; + tty = tty_port_tty_get(&port->state->port); if (!tty) return 0; @@ -364,8 +364,10 @@ receive_chars(struct uart_max3110 *max, unsigned short *str, int len) } } - if (!w) + if (!w) { + tty_kref_put(tty); return 0; + } for (r = 0; w; r += usable, w -= usable) { usable = tty_buffer_request_room(tty, w); @@ -375,6 +377,7 @@ receive_chars(struct uart_max3110 *max, unsigned short *str, int len) } } tty_flip_buffer_push(tty); + tty_kref_put(tty); return r; }