]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:02 +0000 (14:03 +0100)
commit97d817c1145036f451cae939e71297f9fa9348da
tree779dc64b7d70948386d2e68b719b51ebe35c1be3
parent4d9bebb2e9b6ddcca359e8701e09ae8f4cfdf9ae
iio: core: add missing mutex_destroy in iio_dev_release()

[ Upstream commit f5d203467a31798191365efeb16cd619d2c8f23a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/industrialio-core.c