Commit 5210af7
iio: core: add missing mutex_destroy in iio_dev_release()
[ Upstream commit f5d2034 ]
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: 847ec80 ("Staging: IIO: core support for device registration and management")
Fixes: ac917a8 ("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>
Stable-dep-of: 9910159 ("iio: core: add separate lockdep class for info_exist_lock")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 5c9737b commit 5210af7
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1631 | 1634 | | |
1632 | 1635 | | |
1633 | 1636 | | |
| |||
1672 | 1675 | | |
1673 | 1676 | | |
1674 | 1677 | | |
1675 | | - | |
1676 | | - | |
| 1678 | + | |
1677 | 1679 | | |
1678 | 1680 | | |
1679 | 1681 | | |
| |||
1696 | 1698 | | |
1697 | 1699 | | |
1698 | 1700 | | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1699 | 1704 | | |
1700 | 1705 | | |
1701 | 1706 | | |
| |||
0 commit comments