summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb_wwan.c
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2011-02-10 15:33:37 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 10:51:13 -0800
commit9a91aedca2f4ef24344b7cd8f56570e620fbe4d5 (patch)
treec62af4d5e6c493508b1ddb1b33efbca62a6f67f1 /drivers/usb/serial/usb_wwan.c
parent16871dcac74c63227aa92e0012f3004a648c2062 (diff)
usb_wwan: fix error case in close()
The device never needs to be resumed in close(). But the counters must be balanced. As resumption can fail, but the counters must be balanced, use the _no_resume() version which cannot fail. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb_wwan.c')
-rw-r--r--drivers/usb/serial/usb_wwan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index fe5e48eb969..817e6ff8de8 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -424,6 +424,7 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
spin_lock_irq(&intfdata->susp_lock);
portdata->opened = 1;
spin_unlock_irq(&intfdata->susp_lock);
+ /* this balances a get in the generic USB serial code */
usb_autopm_put_interface(serial->interface);
return 0;
@@ -450,7 +451,8 @@ void usb_wwan_close(struct usb_serial_port *port)
usb_kill_urb(portdata->in_urbs[i]);
for (i = 0; i < N_OUT_URB; i++)
usb_kill_urb(portdata->out_urbs[i]);
- usb_autopm_get_interface(serial->interface);
+ /* balancing - important as an error cannot be handled*/
+ usb_autopm_get_interface_no_resume(serial->interface);
serial->interface->needs_remote_wakeup = 0;
}
}