Commit fbffb8c
reset: gpio: fix double free in reset_add_gpio_aux_device() error path
When __auxiliary_device_add() fails, reset_add_gpio_aux_device()
calls auxiliary_device_uninit(adev).
The device release callback reset_gpio_aux_device_release() frees
adev, but the current error path then calls kfree(adev) again,
causing a double free.
Keep kfree(adev) for the auxiliary_device_init() failure path, but
avoid freeing adev after auxiliary_device_uninit().
Fixes: 5fc4e4c ("reset: gpio: use software nodes to setup the GPIO lookup")
Cc: [email protected]
Signed-off-by: Guangshuo Li <[email protected]>
Reviewed-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>1 parent c961cc8 commit fbffb8c
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
860 | 859 | | |
861 | 860 | | |
862 | 861 | | |
| |||
0 commit comments