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

Details

Provenance
andrewAuthored on Dec 9 2024, 3:14 PM
Differential Revision
D47670: acpi_gpiobus: Fix cleanup on set flags failure
Parents
rG65ec52e6e09f: buf_ring: Remove unneeded memory barriers
Branches
Unknown
Tags
Unknown