Merge tag 'fixes-for-v5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

USB: fixes for v5.10-rc2

Nothing major as of yet, we're adding support for Intel Alder Lake-S
in dwc3, together with a few fixes that are quite important (memory
leak in raw-gadget, probe crashes in goku_udc, and so on).

Signed-off-by: Felipe Balbi <balbi@kernel.org>

* tag 'fixes-for-v5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb:
usb: raw-gadget: fix memory leak in gadget_setup
usb: dwc2: Avoid leaving the error_debugfs label unused
usb: dwc3: ep0: Fix delay status handling
usb: gadget: fsl: fix null pointer checking
usb: gadget: goku_udc: fix potential crashes in probe
usb: dwc3: pci: add support for the Intel Alder Lake-S

+15 -4
+3
drivers/usb/dwc2/platform.c
··· 608 #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ 609 return 0; 610 611 error_debugfs: 612 dwc2_debugfs_exit(hsotg); 613 if (hsotg->hcd_enabled) 614 dwc2_hcd_remove(hsotg); 615 error_drd: 616 dwc2_drd_exit(hsotg); 617
··· 608 #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ 609 return 0; 610 611 + #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ 612 + IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) 613 error_debugfs: 614 dwc2_debugfs_exit(hsotg); 615 if (hsotg->hcd_enabled) 616 dwc2_hcd_remove(hsotg); 617 + #endif 618 error_drd: 619 dwc2_drd_exit(hsotg); 620
+4
drivers/usb/dwc3/dwc3-pci.c
··· 40 #define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee 41 #define PCI_DEVICE_ID_INTEL_TGPH 0x43ee 42 #define PCI_DEVICE_ID_INTEL_JSP 0x4dee 43 44 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" 45 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 ··· 366 (kernel_ulong_t) &dwc3_pci_intel_properties, }, 367 368 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_JSP), 369 (kernel_ulong_t) &dwc3_pci_intel_properties, }, 370 371 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_NL_USB),
··· 40 #define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee 41 #define PCI_DEVICE_ID_INTEL_TGPH 0x43ee 42 #define PCI_DEVICE_ID_INTEL_JSP 0x4dee 43 + #define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1 44 45 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" 46 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 ··· 365 (kernel_ulong_t) &dwc3_pci_intel_properties, }, 366 367 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_JSP), 368 + (kernel_ulong_t) &dwc3_pci_intel_properties, }, 369 + 370 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADLS), 371 (kernel_ulong_t) &dwc3_pci_intel_properties, }, 372 373 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_NL_USB),
+2 -1
drivers/usb/dwc3/ep0.c
··· 1058 { 1059 unsigned int direction = !dwc->ep0_expect_in; 1060 1061 if (dwc->ep0state != EP0_STATUS_PHASE) 1062 return; 1063 1064 - dwc->delayed_status = false; 1065 __dwc3_ep0_do_control_status(dwc, dwc->eps[direction]); 1066 } 1067
··· 1058 { 1059 unsigned int direction = !dwc->ep0_expect_in; 1060 1061 + dwc->delayed_status = false; 1062 + 1063 if (dwc->ep0state != EP0_STATUS_PHASE) 1064 return; 1065 1066 __dwc3_ep0_do_control_status(dwc, dwc->eps[direction]); 1067 } 1068
+4 -1
drivers/usb/gadget/legacy/raw_gadget.c
··· 564 return -ENODEV; 565 } 566 length = min(arg.length, event->length); 567 - if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) 568 return -EFAULT; 569 570 return 0; 571 } 572
··· 564 return -ENODEV; 565 } 566 length = min(arg.length, event->length); 567 + if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) { 568 + kfree(event); 569 return -EFAULT; 570 + } 571 572 + kfree(event); 573 return 0; 574 } 575
+1 -1
drivers/usb/gadget/udc/fsl_udc_core.c
··· 1051 u32 bitmask; 1052 struct ep_queue_head *qh; 1053 1054 - if (!_ep || _ep->desc || !(_ep->desc->bEndpointAddress&0xF)) 1055 return -ENODEV; 1056 1057 ep = container_of(_ep, struct fsl_ep, ep);
··· 1051 u32 bitmask; 1052 struct ep_queue_head *qh; 1053 1054 + if (!_ep || !_ep->desc || !(_ep->desc->bEndpointAddress&0xF)) 1055 return -ENODEV; 1056 1057 ep = container_of(_ep, struct fsl_ep, ep);
+1 -1
drivers/usb/gadget/udc/goku_udc.c
··· 1760 goto err; 1761 } 1762 1763 spin_lock_init(&dev->lock); 1764 dev->pdev = pdev; 1765 dev->gadget.ops = &goku_ops; ··· 1794 } 1795 dev->regs = (struct goku_udc_regs __iomem *) base; 1796 1797 - pci_set_drvdata(pdev, dev); 1798 INFO(dev, "%s\n", driver_desc); 1799 INFO(dev, "version: " DRIVER_VERSION " %s\n", dmastr()); 1800 INFO(dev, "irq %d, pci mem %p\n", pdev->irq, base);
··· 1760 goto err; 1761 } 1762 1763 + pci_set_drvdata(pdev, dev); 1764 spin_lock_init(&dev->lock); 1765 dev->pdev = pdev; 1766 dev->gadget.ops = &goku_ops; ··· 1793 } 1794 dev->regs = (struct goku_udc_regs __iomem *) base; 1795 1796 INFO(dev, "%s\n", driver_desc); 1797 INFO(dev, "version: " DRIVER_VERSION " %s\n", dmastr()); 1798 INFO(dev, "irq %d, pci mem %p\n", pdev->irq, base);