提交 acf47d4f 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

USB: option: fix runtime PM handling

Fix potential I/O while runtime suspended due to missing PM operations
in send_setup.

Fixes: 383cedc3 ("USB: serial: full autosuspend support for the
option driver")

Cc: <stable@vger.kernel.org>        # v2.6.32
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c2e45d70
......@@ -1923,6 +1923,7 @@ static int option_send_setup(struct usb_serial_port *port)
struct option_private *priv = intfdata->private;
struct usb_wwan_port_private *portdata;
int val = 0;
int res;
portdata = usb_get_serial_port_data(port);
......@@ -1931,9 +1932,17 @@ static int option_send_setup(struct usb_serial_port *port)
if (portdata->rts_state)
val |= 0x02;
return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
res = usb_autopm_get_interface(serial->interface);
if (res)
return res;
res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
0x22, 0x21, val, priv->bInterfaceNumber, NULL,
0, USB_CTRL_SET_TIMEOUT);
usb_autopm_put_interface(serial->interface);
return res;
}
MODULE_AUTHOR(DRIVER_AUTHOR);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册