opnsense-src/sys/dev/gpio
Andrew Turner 32de28db23 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)
2025-02-27 10:10:09 -05:00
..
dwgpio sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_gpiobus.c acpi_gpiobus: Fix cleanup on set flags failure 2025-02-27 10:10:09 -05:00
acpi_gpiobusvar.h GPIO: Add ACPI _AEI support 2024-11-03 08:01:28 -08:00
bytgpio.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
chvgpio.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
chvgpio_reg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gpio_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
gpioaei.c GPIO: Add ACPI _AEI support 2024-11-03 08:01:28 -08:00
gpiobacklight.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpiobus.c gpiobus: Add missing DEVMETHOD for bus_get_rman 2025-02-27 08:09:22 -05:00
gpiobus_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
gpiobusvar.h gpiobus: Make gpiobus_read_ivar extern 2024-11-03 08:01:27 -08:00
gpioc.c kern: Make fileops and filterops tables const where possible 2024-12-03 01:03:42 +00:00
gpioiic.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpiokeys.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpiokeys.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gpiokeys_codes.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpioled.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpioled_fdt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpiomdio.c Remove bogus detach routines 2024-11-30 21:46:07 -05:00
gpiopower.c gpiopower: trigger low, high and both edges 2024-02-17 16:15:10 +02:00
gpiopps.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpioregulator.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gpiospi.c gpiospi: Fix module dependencies. 2024-11-19 12:40:29 +01:00
gpioths.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ofw_gpiobus.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pl061.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pl061.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pl061_acpi.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pl061_fdt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
qoriq_gpio.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
qoriq_gpio.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00