提交 d48bd977 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

USB: fix locking loop by avoiding flush_scheduled_work

This patch (as1027) replaces a call to flush_scheduled_work() -- a
dangerous routine to invoke, especially while holding any sort of lock
-- with calls to cancel_work_sync() and cancel_delayed_work_sync().

This fixes Bugzilla #9532.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f88ed90d
......@@ -522,9 +522,9 @@ static void hub_quiesce(struct usb_hub *hub)
/* (blocking) stop khubd and related activity */
usb_kill_urb(hub->urb);
if (hub->has_indicators)
cancel_delayed_work(&hub->leds);
if (hub->has_indicators || hub->tt.hub)
flush_scheduled_work();
cancel_delayed_work_sync(&hub->leds);
if (hub->tt.hub)
cancel_work_sync(&hub->tt.kevent);
}
static void hub_activate(struct usb_hub *hub)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册