Skip to content

Commit 58d51f3

Browse files
committed
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
2 parents 3cea11c + 129aa97 commit 58d51f3

6 files changed

Lines changed: 15 additions & 4 deletions

File tree

drivers/usb/dwc2/platform.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,13 @@ static int dwc2_driver_probe(struct platform_device *dev)
608608
#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
609609
return 0;
610610

611+
#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
612+
IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
611613
error_debugfs:
612614
dwc2_debugfs_exit(hsotg);
613615
if (hsotg->hcd_enabled)
614616
dwc2_hcd_remove(hsotg);
617+
#endif
615618
error_drd:
616619
dwc2_drd_exit(hsotg);
617620

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee
4141
#define PCI_DEVICE_ID_INTEL_TGPH 0x43ee
4242
#define PCI_DEVICE_ID_INTEL_JSP 0x4dee
43+
#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1
4344

4445
#define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
4546
#define PCI_INTEL_BXT_FUNC_PMU_PWR 4
@@ -367,6 +368,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
367368
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_JSP),
368369
(kernel_ulong_t) &dwc3_pci_intel_properties, },
369370

371+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADLS),
372+
(kernel_ulong_t) &dwc3_pci_intel_properties, },
373+
370374
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_NL_USB),
371375
(kernel_ulong_t) &dwc3_pci_amd_properties, },
372376
{ } /* Terminating Entry */

drivers/usb/dwc3/ep0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,11 @@ void dwc3_ep0_send_delayed_status(struct dwc3 *dwc)
10581058
{
10591059
unsigned int direction = !dwc->ep0_expect_in;
10601060

1061+
dwc->delayed_status = false;
1062+
10611063
if (dwc->ep0state != EP0_STATUS_PHASE)
10621064
return;
10631065

1064-
dwc->delayed_status = false;
10651066
__dwc3_ep0_do_control_status(dwc, dwc->eps[direction]);
10661067
}
10671068

drivers/usb/gadget/legacy/raw_gadget.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,12 @@ static int raw_ioctl_event_fetch(struct raw_dev *dev, unsigned long value)
564564
return -ENODEV;
565565
}
566566
length = min(arg.length, event->length);
567-
if (copy_to_user((void __user *)value, event, sizeof(*event) + length))
567+
if (copy_to_user((void __user *)value, event, sizeof(*event) + length)) {
568+
kfree(event);
568569
return -EFAULT;
570+
}
569571

572+
kfree(event);
570573
return 0;
571574
}
572575

drivers/usb/gadget/udc/fsl_udc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
10511051
u32 bitmask;
10521052
struct ep_queue_head *qh;
10531053

1054-
if (!_ep || _ep->desc || !(_ep->desc->bEndpointAddress&0xF))
1054+
if (!_ep || !_ep->desc || !(_ep->desc->bEndpointAddress&0xF))
10551055
return -ENODEV;
10561056

10571057
ep = container_of(_ep, struct fsl_ep, ep);

drivers/usb/gadget/udc/goku_udc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17601760
goto err;
17611761
}
17621762

1763+
pci_set_drvdata(pdev, dev);
17631764
spin_lock_init(&dev->lock);
17641765
dev->pdev = pdev;
17651766
dev->gadget.ops = &goku_ops;
@@ -1793,7 +1794,6 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17931794
}
17941795
dev->regs = (struct goku_udc_regs __iomem *) base;
17951796

1796-
pci_set_drvdata(pdev, dev);
17971797
INFO(dev, "%s\n", driver_desc);
17981798
INFO(dev, "version: " DRIVER_VERSION " %s\n", dmastr());
17991799
INFO(dev, "irq %d, pci mem %p\n", pdev->irq, base);

0 commit comments

Comments
 (0)