Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Felipe Balbi <balbi@ti.com>

Conflicts:
drivers/usb/phy/phy.c

+21 -4
+1
drivers/usb/gadget/legacy/inode.c
··· 441 441 kbuf = memdup_user(buf, len); 442 442 if (IS_ERR(kbuf)) { 443 443 value = PTR_ERR(kbuf); 444 + kbuf = NULL; 444 445 goto free1; 445 446 } 446 447
+11 -1
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 828 828 { 829 829 struct usba_ep *ep = to_usba_ep(_ep); 830 830 struct usba_udc *udc = ep->udc; 831 - struct usba_request *req = to_usba_req(_req); 831 + struct usba_request *req; 832 832 unsigned long flags; 833 833 u32 status; 834 834 ··· 836 836 ep->ep.name, req); 837 837 838 838 spin_lock_irqsave(&udc->lock, flags); 839 + 840 + list_for_each_entry(req, &ep->queue, queue) { 841 + if (&req->req == _req) 842 + break; 843 + } 844 + 845 + if (&req->req != _req) { 846 + spin_unlock_irqrestore(&udc->lock, flags); 847 + return -EINVAL; 848 + } 839 849 840 850 if (req->using_dma) { 841 851 /*
+9 -3
drivers/usb/phy/phy.c
··· 59 59 { 60 60 struct usb_phy *phy; 61 61 62 + if (!of_device_is_available(node)) 63 + return ERR_PTR(-ENODEV); 64 + 62 65 list_for_each_entry(phy, &phy_list, head) { 63 66 if (node != phy->dev->of_node) 64 67 continue; ··· 193 190 spin_lock_irqsave(&phy_lock, flags); 194 191 195 192 phy = __of_usb_find_phy(node); 196 - if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 197 - if (!IS_ERR(phy)) 198 - phy = ERR_PTR(-ENODEV); 193 + if (IS_ERR(phy)) { 194 + devres_free(ptr); 195 + goto err1; 196 + } 199 197 198 + if (!try_module_get(phy->dev->driver->owner)) { 199 + phy = ERR_PTR(-ENODEV); 200 200 devres_free(ptr); 201 201 goto err1; 202 202 }