mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
acpi_gpiobus: Fix cleanup on set flags failure
When GPIOBUS_PIN_SETFLAGS fails we called gpiobus_free_ivars to clean up the contents of the ivar, then would free the ivar. This lead to a use-after-free as the ivar had already been set on the child so gpiobus_child_deleted would try to free it again. Fix this by removing the early cleanup and letting gpiobus_child_deleted handle it. Fixes:c9e880c0ce("gpiobus: Use a bus_child_deleted method to free ivars for children") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47670 (cherry picked from commitbb8c68b253)
This commit is contained in:
parent
e75ef6dece
commit
32de28db23
1 changed files with 0 additions and 2 deletions
|
|
@ -201,8 +201,6 @@ acpi_gpiobus_enumerate_aei(ACPI_RESOURCE *res, void *context)
|
|||
|
||||
for (int i = 0; i < devi->gpiobus.npins; i++) {
|
||||
if (GPIOBUS_PIN_SETFLAGS(bus, child, 0, devi->flags)) {
|
||||
gpiobus_free_ivars(&devi->gpiobus);
|
||||
free(devi, M_DEVBUF);
|
||||
device_delete_child(bus, child);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue