Commit 9a91aedc authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

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: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 16871dca
...@@ -424,6 +424,7 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -424,6 +424,7 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
spin_lock_irq(&intfdata->susp_lock); spin_lock_irq(&intfdata->susp_lock);
portdata->opened = 1; portdata->opened = 1;
spin_unlock_irq(&intfdata->susp_lock); spin_unlock_irq(&intfdata->susp_lock);
/* this balances a get in the generic USB serial code */
usb_autopm_put_interface(serial->interface); usb_autopm_put_interface(serial->interface);
return 0; return 0;
...@@ -450,7 +451,8 @@ void usb_wwan_close(struct usb_serial_port *port) ...@@ -450,7 +451,8 @@ void usb_wwan_close(struct usb_serial_port *port)
usb_kill_urb(portdata->in_urbs[i]); usb_kill_urb(portdata->in_urbs[i]);
for (i = 0; i < N_OUT_URB; i++) for (i = 0; i < N_OUT_URB; i++)
usb_kill_urb(portdata->out_urbs[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; serial->interface->needs_remote_wakeup = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment