From: Oliver Neukum Date: Wed, 20 Nov 2013 10:35:36 +0000 (+0100) Subject: cdc-acm: fix power management in ioctl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8fdbeb26b5105282e55559b54a660fe7b6eed331;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- 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);