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

Commit 4e608671 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

cdc-acm: remove dead code



The wait_event_interruptible_timeout in acm_port_down is
never reached. Remove it to avoid possible deadlocks
with the big tty mutex if someone were to start using
the blocking version of acm_port_down.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 83ceb67d
Loading
Loading
Loading
Loading
+3 −9
Original line number Original line Diff line number Diff line
@@ -636,19 +636,13 @@ static void acm_tty_unregister(struct acm *acm)


static int acm_tty_chars_in_buffer(struct tty_struct *tty);
static int acm_tty_chars_in_buffer(struct tty_struct *tty);


static void acm_port_down(struct acm *acm, int drain)
static void acm_port_down(struct acm *acm)
{
{
	int i, nr = acm->rx_buflimit;
	int i, nr = acm->rx_buflimit;
	mutex_lock(&open_mutex);
	mutex_lock(&open_mutex);
	if (acm->dev) {
	if (acm->dev) {
		usb_autopm_get_interface(acm->control);
		usb_autopm_get_interface(acm->control);
		acm_set_control(acm, acm->ctrlout = 0);
		acm_set_control(acm, acm->ctrlout = 0);
		/* try letting the last writes drain naturally */
		if (drain) {
			wait_event_interruptible_timeout(acm->drain_wait,
				(ACM_NW == acm_wb_is_avail(acm)) || !acm->dev,
					ACM_CLOSE_TIMEOUT * HZ);
		}
		usb_kill_urb(acm->ctrlurb);
		usb_kill_urb(acm->ctrlurb);
		for (i = 0; i < ACM_NW; i++)
		for (i = 0; i < ACM_NW; i++)
			usb_kill_urb(acm->wb[i].urb);
			usb_kill_urb(acm->wb[i].urb);
@@ -664,7 +658,7 @@ static void acm_tty_hangup(struct tty_struct *tty)
{
{
	struct acm *acm = tty->driver_data;
	struct acm *acm = tty->driver_data;
	tty_port_hangup(&acm->port);
	tty_port_hangup(&acm->port);
	acm_port_down(acm, 0);
	acm_port_down(acm);
}
}


static void acm_tty_close(struct tty_struct *tty, struct file *filp)
static void acm_tty_close(struct tty_struct *tty, struct file *filp)
@@ -685,7 +679,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
		mutex_unlock(&open_mutex);
		mutex_unlock(&open_mutex);
		return;
		return;
	}
	}
	acm_port_down(acm, 0);
	acm_port_down(acm);
	tty_port_close_end(&acm->port, tty);
	tty_port_close_end(&acm->port, tty);
	tty_port_tty_set(&acm->port, NULL);
	tty_port_tty_set(&acm->port, NULL);
}
}