iio: trigger: add missing mutex_destroy in iio_trig_release
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.
---
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(+)
drivers/iio/industrialio-trigger.c +1 -0
@@ -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); }
Signature · 1 line
2.17.1
Quoted 5 lines · Ma Ke
Add missing
mutex_destroy()call iniio_trig_release()to properly clean up the mutex initialized inviio_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
The change otherwise LGTM (no need to resend this time),
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 7 lines · Ma Ke
Add missing
mutex_destroy()call iniio_trig_release()to properly clean up the mutex initialized inviio_trigger_alloc(). Ensure proper resource cleanup and follows kernel practices.Found by code review.
Signed-off-by Ma Ke <[email protected]>
Quoted 8 lines
---
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.
---
Quoted 15 lines
drivers/iio/industrialio-trigger.c | 1 +
1 file changed, 1 insertion(+)drivers/iio/industrialio-trigger.c +1
-0@@ -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); }