[PATCH RFC/RFT 03/15] gpio: sysfs: call mutex_destroy() in gpiod_unexport()
From: Bartosz Golaszewski
Date: Tue Jun 10 2025 - 10:39:25 EST
From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
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@xxxxxxxxxx>
---
drivers/gpio/gpiolib-sysfs.c | 1 +
1 file changed, 1 insertion(+)
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);
--
2.48.1