diff mbox series

[RFC/RFT,03/15] gpio: sysfs: call mutex_destroy() in gpiod_unexport()

Message ID 20250610-gpio-sysfs-chip-export-v1-3-a8c7aa4478b1@linaro.org
State New
Headers show
Series gpio: sysfs: add a per-chip export/unexport attribute pair | expand

Commit Message

Bartosz Golaszewski June 10, 2025, 2:38 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

While not critical, it's useful to have the corresponding call to
mutex_destroy() whenever we use mutex_init(). Add the call right before
kfreeing the GPIO data.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpiolib-sysfs.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 4a3aa09dad9d54dc77f28d596723fd5546cb3ae8..cd3381a4bc93a94b9a975248ae3e4bd8c2a3eb4b 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -713,6 +713,7 @@  void gpiod_unexport(struct gpio_desc *desc)
 	}
 
 	put_device(dev);
+	mutex_destroy(&data->mutex);
 	kfree(data);
 }
 EXPORT_SYMBOL_GPL(gpiod_unexport);