HomeFreeBSD

acpi_gpiobus: Fix cleanup on set flags failure

Description

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: c9e880c0ceef ("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 commit bb8c68b25333638a20838500ccffee23b4291427)

Details

Provenance
andrewAuthored on Dec 9 2024, 3:14 PM
jhbCommitted on Thu, Feb 27, 3:10 PM
Differential Revision
D47670: acpi_gpiobus: Fix cleanup on set flags failure
Parents
rGe75ef6dece8d: twe.4: Remove manpage for previously-removed driver
Branches
Unknown
Tags
Unknown