From: Johan Hovold Date: Thu, 21 Mar 2013 11:37:48 +0000 (+0100) Subject: USB: garmin_gps: remove bogus disconnect test in close X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91972724525829a9399a2cb41e60cad853b09229;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git USB: garmin_gps: remove bogus disconnect test in close Remove bogus disconnect test for serial device being NULL in close. This can never happen as close is guaranteed to be called before the last tty reference is dropped (and port->serial is cleared). Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 81caf5623ee2..1ade6cf23f7e 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -946,16 +946,12 @@ static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port) static void garmin_close(struct usb_serial_port *port) { - struct usb_serial *serial = port->serial; struct garmin_data *garmin_data_p = usb_get_serial_port_data(port); dev_dbg(&port->dev, "%s - port %d - mode=%d state=%d flags=0x%X\n", __func__, port->number, garmin_data_p->mode, garmin_data_p->state, garmin_data_p->flags); - if (!serial) - return; - garmin_clear(garmin_data_p); /* shutdown our urbs */