Commit 06087cb4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v3.19-rc5' of...

Merge tag 'fixes-for-v3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v3.19-rc5

Just three fixes this time. An oops fix in ep_write() from gadgetfs,
another oops for the Atmel UDC when unloading a gadget driver and
the fix for PHY deferred probing.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>

Conflicts:
	drivers/usb/phy/phy.c
parents 9c9d8249 5fb694f9
...@@ -441,6 +441,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) ...@@ -441,6 +441,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
kbuf = memdup_user(buf, len); kbuf = memdup_user(buf, len);
if (IS_ERR(kbuf)) { if (IS_ERR(kbuf)) {
value = PTR_ERR(kbuf); value = PTR_ERR(kbuf);
kbuf = NULL;
goto free1; goto free1;
} }
......
...@@ -828,7 +828,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) ...@@ -828,7 +828,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{ {
struct usba_ep *ep = to_usba_ep(_ep); struct usba_ep *ep = to_usba_ep(_ep);
struct usba_udc *udc = ep->udc; struct usba_udc *udc = ep->udc;
struct usba_request *req = to_usba_req(_req); struct usba_request *req;
unsigned long flags; unsigned long flags;
u32 status; u32 status;
...@@ -837,6 +837,16 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) ...@@ -837,6 +837,16 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
spin_lock_irqsave(&udc->lock, flags); spin_lock_irqsave(&udc->lock, flags);
list_for_each_entry(req, &ep->queue, queue) {
if (&req->req == _req)
break;
}
if (&req->req != _req) {
spin_unlock_irqrestore(&udc->lock, flags);
return -EINVAL;
}
if (req->using_dma) { if (req->using_dma) {
/* /*
* If this request is currently being transferred, * If this request is currently being transferred,
......
...@@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node) ...@@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node)
{ {
struct usb_phy *phy; struct usb_phy *phy;
if (!of_device_is_available(node))
return ERR_PTR(-ENODEV);
list_for_each_entry(phy, &phy_list, head) { list_for_each_entry(phy, &phy_list, head) {
if (node != phy->dev->of_node) if (node != phy->dev->of_node)
continue; continue;
...@@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, ...@@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
spin_lock_irqsave(&phy_lock, flags); spin_lock_irqsave(&phy_lock, flags);
phy = __of_usb_find_phy(node); phy = __of_usb_find_phy(node);
if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { if (IS_ERR(phy)) {
if (!IS_ERR(phy)) devres_free(ptr);
phy = ERR_PTR(-ENODEV); goto err1;
}
if (!try_module_get(phy->dev->driver->owner)) {
phy = ERR_PTR(-ENODEV);
devres_free(ptr); devres_free(ptr);
goto err1; goto err1;
} }
......
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