Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3edbc986 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

USB: kl5kusb105 don't flush to logically disconnected devices



If disconnect() is called for a logical disconnect, no more IO must be
done after disconnect() returns, or the old and new drivers may conflict.
This patch avoids this by using the flag and lock introduced by the earlier
patch for the mos7720 driver.

Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b0a239da
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -461,6 +461,8 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)

	dbg("%s port %d", __FUNCTION__, port->number);

	mutex_lock(&port->serial->disc_mutex);
	if (!port->serial->disconnected) {
		/* send READ_OFF */
		rc = usb_control_msg (port->serial->dev,
				      usb_sndctrlpipe(port->serial->dev, 0),
@@ -472,6 +474,8 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
				      KLSI_TIMEOUT);
		if (rc < 0)
			err("Disabling read failed (error = %d)", rc);
	}
	mutex_unlock(&port->serial->disc_mutex);

	/* shutdown our bulk reads and writes */
	usb_kill_urb(port->write_urb);