summaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2013-11-20 11:35:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-03 10:23:46 -0800
commit8fdbeb26b5105282e55559b54a660fe7b6eed331 (patch)
tree45e46c0efebf776fcd6aff9442f2030f8f0e3037 /drivers/usb/class
parent797ef13716ce05d26c5be12893ca75b2b003f25f (diff)
downloadop-kernel-dev-8fdbeb26b5105282e55559b54a660fe7b6eed331.zip
op-kernel-dev-8fdbeb26b5105282e55559b54a660fe7b6eed331.tar.gz
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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 92e28ec..8fe32eb 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);
OpenPOWER on IntegriCloud