git: 712623ab14b9 - stable/15 - generic_ehci_fdt: fix driver softc size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 09 Jul 2026 17:49:36 UTC
The branch stable/15 has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=712623ab14b940cf2fcd86cf61e7e70469e414a2
commit 712623ab14b940cf2fcd86cf61e7e70469e414a2
Author: Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2026-06-30 14:58:11 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-07-09 17:49:13 +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
(cherry picked from commit d5332d3a904242cb82e7dbf35e4aeec7c2df4402)
---
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);