diff options
author | Oliver Neukum <oneukum@suse.de> | 2013-11-20 11:35:36 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-03 10:23:46 -0800 |
commit | 8fdbeb26b5105282e55559b54a660fe7b6eed331 (patch) | |
tree | 45e46c0efebf776fcd6aff9442f2030f8f0e3037 /drivers/usb/class | |
parent | 797ef13716ce05d26c5be12893ca75b2b003f25f (diff) | |
download | linux-8fdbeb26b5105282e55559b54a660fe7b6eed331.tar.bz2 |
cdc-acm: fix power management in ioctl
An ioctl that does depends on communication with a device should
prevent suspension of teh device.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 92e28ecda834..8fe32eb7970e 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -888,7 +888,13 @@ static int acm_tty_ioctl(struct tty_struct *tty, rv = set_serial_info(acm, (struct serial_struct __user *) arg); break; case TIOCMIWAIT: + rv = usb_autopm_get_interface(acm->control); + if (rv < 0) { + rv = -EIO; + break; + } rv = wait_serial_change(acm, arg); + usb_autopm_put_interface(acm->control); break; case TIOCGICOUNT: rv = get_serial_usage(acm, (struct serial_icounter_struct __user *) arg); |