提交 caa2a122 编写于 作者: F Franck Bui-Huu 提交者: Greg Kroah-Hartman

[PATCH] Fix a deadlock in usbtest

ctrl_complete functions acquires ctx->lock and tries to unlink
all queued urbs in case of errors through usb_unlink_urb func.
In its turn usb_unlink_urb calls, through the hcd driver,
usb_hcd_giveback_urb which calls ctrl_complete again. At this
time, ctx->lock is already taken by the same function.
Signed-off-by: NFranck Bui-Huu <vagabon.xyz@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c8155cc5
......@@ -802,7 +802,9 @@ static void ctrl_complete (struct urb *urb, struct pt_regs *regs)
if (u == urb || !u->dev)
continue;
spin_unlock(&ctx->lock);
status = usb_unlink_urb (u);
spin_lock(&ctx->lock);
switch (status) {
case -EINPROGRESS:
case -EBUSY:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册