diff options
| author | Mitchell Horne <mhorne@FreeBSD.org> | 2026-06-30 14:58:11 +0000 |
|---|---|---|
| committer | Mitchell Horne <mhorne@FreeBSD.org> | 2026-06-30 14:59:40 +0000 |
| commit | d5332d3a904242cb82e7dbf35e4aeec7c2df4402 (patch) | |
| tree | 5cefb865535a3ca397585cbdc562eccd13a6d4fe | |
| parent | b8c6f5811b2a948a265a4bd90d33a18efb2a6f1e (diff) | |
generic_ehci_fdt: fix driver softc size
This subclass declares its own softc structure adding necessary members
after the embedded ehci_softc_t. The full size of the struct must be
included in the driver declaration, otherwise the allocation backing the
softc is not guaranteed to be large enough.
Reported by: KASAN
Reviewed by: jrtc27, manu
Fixes: 7a58744fd0f1 ("Split out the attachment from the generic-ehci driver")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57951
| -rw-r--r-- | sys/dev/usb/controller/generic_ehci_fdt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/usb/controller/generic_ehci_fdt.c b/sys/dev/usb/controller/generic_ehci_fdt.c index df2dc7fba4b9..8271061d274d 100644 --- a/sys/dev/usb/controller/generic_ehci_fdt.c +++ b/sys/dev/usb/controller/generic_ehci_fdt.c @@ -232,7 +232,7 @@ static device_method_t ehci_fdt_methods[] = { }; DEFINE_CLASS_1(ehci, ehci_fdt_driver, ehci_fdt_methods, - sizeof(ehci_softc_t), generic_ehci_driver); + sizeof(struct generic_ehci_fdt_softc), generic_ehci_driver); DRIVER_MODULE(generic_ehci, simplebus, ehci_fdt_driver, 0, 0); MODULE_DEPEND(generic_ehci, usb, 1, 1, 1); |
