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 19:23:46 +0100
commit8fdbeb26b5105282e55559b54a660fe7b6eed331 (patch)
tree45e46c0efebf776fcd6aff9442f2030f8f0e3037 /drivers/usb/class
parentcdc-acm: add TIOCGICOUNT (diff)
downloadlinux-8fdbeb26b5105282e55559b54a660fe7b6eed331.tar.xz
linux-8fdbeb26b5105282e55559b54a660fe7b6eed331.zip
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 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);