public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/2] iio: trigger: add missing mutex_destroy in iio_trig_release
@ 2025-11-10  3:57 Ma Ke
  2025-11-10  5:26 ` Andy Shevchenko
  2025-11-10 14:50 ` Nuno Sá
  0 siblings, 2 replies; 3+ messages in thread
From: Ma Ke @ 2025-11-10  3:57 UTC (permalink / raw)
  To: jic23, dlechner, nuno.sa, andy; +Cc: linux-iio, linux-kernel, akpm, Ma Ke

Add missing mutex_destroy() call in iio_trig_release() to properly
clean up the mutex initialized in viio_trigger_alloc(). Ensure proper
resource cleanup and follows kernel practices.

Found by code review.

Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
Changes in v4:
- split the patch into two independent patches and modified according to developer's suggestions;
Changes in v3:
- modified the patch;
Changes in v2:
- modified the patch, thanks for developer's suggestions.
---
 drivers/iio/industrialio-trigger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 54416a384232..5baa83349e8f 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -524,6 +524,7 @@ static void iio_trig_release(struct device *device)
 			       CONFIG_IIO_CONSUMERS_PER_TRIGGER);
 	}
 	kfree(trig->name);
+	mutex_destroy(&trig->pool_lock);
 	kfree(trig);
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-10 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10  3:57 [PATCH v4 1/2] iio: trigger: add missing mutex_destroy in iio_trig_release Ma Ke
2025-11-10  5:26 ` Andy Shevchenko
2025-11-10 14:50 ` Nuno Sá

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox