Commit 9e0aea63 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Make usbcore use usb_kill_urb()

This patch changes the only places in usbcore where usb_unlink_urb() is
still used for synchronous unlinking; now they will use usb_kill_urb().
As it turns out, there were only a couple of changes needed.

This still leaves all the drivers to audit!
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 98b069b9
...@@ -286,9 +286,10 @@ static void destroy_async (struct dev_state *ps, struct list_head *list) ...@@ -286,9 +286,10 @@ static void destroy_async (struct dev_state *ps, struct list_head *list)
while (!list_empty(list)) { while (!list_empty(list)) {
as = list_entry(list->next, struct async, asynclist); as = list_entry(list->next, struct async, asynclist);
list_del_init(&as->asynclist); list_del_init(&as->asynclist);
/* drop the spinlock so the completion handler can run */
spin_unlock_irqrestore(&ps->lock, flags); spin_unlock_irqrestore(&ps->lock, flags);
/* usb_unlink_urb calls the completion handler with status == -ENOENT */ usb_kill_urb(as->urb);
usb_unlink_urb(as->urb);
spin_lock_irqsave(&ps->lock, flags); spin_lock_irqsave(&ps->lock, flags);
} }
spin_unlock_irqrestore(&ps->lock, flags); spin_unlock_irqrestore(&ps->lock, flags);
...@@ -976,7 +977,7 @@ static int proc_unlinkurb(struct dev_state *ps, void __user *arg) ...@@ -976,7 +977,7 @@ static int proc_unlinkurb(struct dev_state *ps, void __user *arg)
as = async_getpending(ps, arg); as = async_getpending(ps, arg);
if (!as) if (!as)
return -EINVAL; return -EINVAL;
usb_unlink_urb(as->urb); usb_kill_urb(as->urb);
return 0; return 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