git: d5332d3a9042 - main - generic_ehci_fdt: fix driver softc size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 30 Jun 2026 14:59:48 UTC
The branch main has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=d5332d3a904242cb82e7dbf35e4aeec7c2df4402
commit d5332d3a904242cb82e7dbf35e4aeec7c2df4402
Author: Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2026-06-30 14:58:11 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-06-30 14:59:40 +0000
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
---
sys/dev/usb/controller/generic_ehci_fdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);