From 737a1030cd49a18f8298522eafd582849717d1a4 Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Mon, 20 Oct 2008 08:11:15 +0200 Subject: [PATCH] UBUNTU: SAUCE: usb-serial: Prevent writes in indat callback when dev is closed Signed-off-by: Stefan Bader --- drivers/usb/serial/sierra.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ea1a103..73d474a 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -440,13 +440,15 @@ static void sierra_indat_callback(struct urb *urb) dbg("%s: nonzero status: %d on endpoint %02x.", __func__, status, endpoint); } else { - tty = port->port.tty; - if (urb->actual_length) { + if (urb->actual_length && port->port.count) { + tty = port->port.tty; tty_buffer_request_room(tty, urb->actual_length); tty_insert_flip_string(tty, data, urb->actual_length); tty_flip_buffer_push(tty); - } else { + } else if (port->port.count) { dbg("%s: empty read urb received", __func__); + } else { + dbg("%s: zero status after close", __func__); } /* Resubmit urb so we continue receiving */ -- 1.5.4.3