]> Gentwo Git Trees - linux/.git/commit
iio: core: add missing mutex_destroy in iio_dev_release()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 12 Nov 2025 14:55:08 +0000 (15:55 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Nov 2025 17:28:02 +0000 (17:28 +0000)
commitf5d203467a31798191365efeb16cd619d2c8f23a
tree888b8728bb9256bf98c789e1f9caa7da0a28656a
parent0ecad1964315bf171d4eb0874da65e3a7aeb1b3d
iio: core: add missing mutex_destroy in iio_dev_release()

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

Found by code review.

While at it, create a lockdep key before mutex initialisation.
This will help with converting it to the better API in the future.

Fixes: 847ec80bbaa7 ("Staging: IIO: core support for device registration and management")
Fixes: ac917a81117c ("staging:iio:core set the iio_dev.info pointer to null on unregister under lock.")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c