[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251110035701.36691-1-make24@iscas.ac.cn>
Date: Mon, 10 Nov 2025 11:57:01 +0800
From: Ma Ke <make24@...as.ac.cn>
To: jic23@...nel.org,
dlechner@...libre.com,
nuno.sa@...log.com,
andy@...nel.org
Cc: linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org,
Ma Ke <make24@...as.ac.cn>
Subject: [PATCH v4 1/2] iio: trigger: add missing mutex_destroy in iio_trig_release
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@...as.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
Powered by blists - more mailing lists