* [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
* Re: [PATCH v4 1/2] iio: trigger: add missing mutex_destroy in iio_trig_release
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á
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-11-10 5:26 UTC (permalink / raw)
To: Ma Ke; +Cc: jic23, dlechner, nuno.sa, andy, linux-iio, linux-kernel, akpm
On Mon, Nov 10, 2025 at 11:57:01AM +0800, Ma Ke wrote:
> 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.
First of all, the patches should form the series and include a cover letter,
usually it can be done by running
git format-patch -v<X> --cover-letter --base ...
against the branch where changes are located on top of.
Then, here makes sense to add
Suggested-by:: Andy Shevchenko <andriy.shevchenko@intel.com>
The change otherwise LGTM (no need to resend this time),
Reviewed-by:: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4 1/2] iio: trigger: add missing mutex_destroy in iio_trig_release
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á
1 sibling, 0 replies; 3+ messages in thread
From: Nuno Sá @ 2025-11-10 14:50 UTC (permalink / raw)
To: Ma Ke, jic23, dlechner, nuno.sa, andy; +Cc: linux-iio, linux-kernel, akpm
On Mon, 2025-11-10 at 11:57 +0800, Ma Ke wrote:
> 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.
> ---
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> 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);
> }
>
^ permalink raw reply [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