From eee283f2d7fb205318fbb326347a3e6d6bf09d2a Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Thu, 13 Sep 2012 22:56:55 +0400 Subject: [PATCH] --- yaml --- r: 326033 b: refs/heads/master c: 8321652ae22f38830af5b553f3a316d68948ddce h: refs/heads/master i: 326031: c00fc2079d2c48281f609625bb6086248514458e v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/omninet.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 403f097ad182..8f047863f571 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 17e6791082e3dc34d0b43fd50ff8655fdfcc3a99 +refs/heads/master: 8321652ae22f38830af5b553f3a316d68948ddce diff --git a/trunk/drivers/usb/serial/omninet.c b/trunk/drivers/usb/serial/omninet.c index d31f661d758c..f524cd910e2c 100644 --- a/trunk/drivers/usb/serial/omninet.c +++ b/trunk/drivers/usb/serial/omninet.c @@ -185,10 +185,12 @@ static void omninet_read_bulk_callback(struct urb *urb) if (urb->actual_length && header->oh_len) { struct tty_struct *tty = tty_port_tty_get(&port->port); - tty_insert_flip_string(tty, data + OMNINET_DATAOFFSET, + if (tty) { + tty_insert_flip_string(tty, data + OMNINET_DATAOFFSET, header->oh_len); - tty_flip_buffer_push(tty); - tty_kref_put(tty); + tty_flip_buffer_push(tty); + tty_kref_put(tty); + } } /* Continue trying to always read */