提交 5adceac5 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: fix errornous assumption in the usb serial framework revealed by iuu_phoenix

the iuu_phoenix driver submits another URB from a completion handler.
This dictates a certain order of calls to usb_kill_urb() in kill_traffic().
As other drivers may do it the other way round, we need to use both
orders in kill_traffic().
This patch does so and should be merged before iuu_phoenix is merged.
Signed-off-by: NOliver Neukum <oneukum@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 b5b80f2b
......@@ -578,6 +578,17 @@ static void kill_traffic(struct usb_serial_port *port)
{
usb_kill_urb(port->read_urb);
usb_kill_urb(port->write_urb);
/*
* This is tricky.
* Some drivers submit the read_urb in the
* handler for the write_urb or vice versa
* this order determines the order in which
* usb_kill_urb() must be used to reliably
* kill the URBs. As it is unknown here,
* both orders must be used in turn.
* The call below is not redundant.
*/
usb_kill_urb(port->read_urb);
usb_kill_urb(port->interrupt_in_urb);
usb_kill_urb(port->interrupt_out_urb);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册