Commit d612b753 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

usb uhci.c:

	- added usb_get_urb() and usb_put_urb() logic
parent cbe22f98
...@@ -1492,6 +1492,9 @@ static int uhci_submit_urb(struct urb *urb, int mem_flags) ...@@ -1492,6 +1492,9 @@ static int uhci_submit_urb(struct urb *urb, int mem_flags)
return -ENODEV; return -ENODEV;
} }
/* increment the reference count of the urb, as we now also control it */
urb = usb_get_urb(urb);
uhci = (struct uhci *)urb->dev->bus->hcpriv; uhci = (struct uhci *)urb->dev->bus->hcpriv;
INIT_LIST_HEAD(&urb->urb_list); INIT_LIST_HEAD(&urb->urb_list);
...@@ -1505,6 +1508,7 @@ static int uhci_submit_urb(struct urb *urb, int mem_flags) ...@@ -1505,6 +1508,7 @@ static int uhci_submit_urb(struct urb *urb, int mem_flags)
/* Since we can have problems on the out path */ /* Since we can have problems on the out path */
spin_unlock_irqrestore(&urb->lock, flags); spin_unlock_irqrestore(&urb->lock, flags);
usb_dec_dev_use(urb->dev); usb_dec_dev_use(urb->dev);
usb_put_urb(urb);
return ret; return ret;
} }
...@@ -2299,6 +2303,7 @@ static void uhci_call_completion(struct urb *urb) ...@@ -2299,6 +2303,7 @@ static void uhci_call_completion(struct urb *urb)
/* We decrement the usage count after we're done */ /* We decrement the usage count after we're done */
/* with everything */ /* with everything */
usb_dec_dev_use(dev); usb_dec_dev_use(dev);
usb_put_urb(urb);
} }
} }
} }
......
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