Commit d382c765 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: shared: fix auxiliary device cleanup order

Dropping the last reference to the internal struct device should be the
last thing we do so delete the device first and then uninit it which
also involves the final put_device().

Fixes: a060b8c5 ("gpiolib: implement low-level, shared GPIO support")
Link: https://lore.kernel.org/r/20251206-gpio-shared-teardown-fixes-v1-3-35ac458cfce1@oss.qualcomm.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
parent c904a0d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -415,8 +415,8 @@ static void gpio_shared_remove_adev(struct auxiliary_device *adev)
{
	lockdep_assert_held(&gpio_shared_lock);

	auxiliary_device_uninit(adev);
	auxiliary_device_delete(adev);
	auxiliary_device_uninit(adev);
}

int gpio_device_setup_shared(struct gpio_device *gdev)