Page MenuHomeFreeBSD

acpi_gpiobus: Fix cleanup on set flags failure
ClosedPublic

Authored by andrew on Nov 19 2024, 1:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 18, 7:02 AM
Unknown Object (File)
Sun, May 17, 2:35 AM
Unknown Object (File)
Sun, May 17, 1:41 AM
Unknown Object (File)
Thu, May 7, 8:24 PM
Unknown Object (File)
Wed, Apr 29, 10:35 PM
Unknown Object (File)
Apr 20 2026, 4:43 AM
Unknown Object (File)
Apr 15 2026, 11:04 PM
Unknown Object (File)
Apr 15 2026, 5:26 AM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable