]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: core: fix ioctl handlers removal
authorTomasz Duszynski <tomasz.duszynski@octakon.com>
Fri, 23 Apr 2021 08:02:44 +0000 (10:02 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 24 Apr 2021 10:53:00 +0000 (11:53 +0100)
commit4d28b580e80a214d18bd2bf15162d0f9052e4dfc
tree95738bd3fabdc2258f36bf5b8f88db8a58ca660a
parent2d84ea101372ac93db458c38f80a8644b6a17f99
iio: core: fix ioctl handlers removal

Currently ioctl handlers are removed twice. For the first time during
iio_device_unregister() then later on inside
iio_device_unregister_eventset() and iio_buffers_free_sysfs_and_mask().
Double free leads to kernel panic.

Fix this by not touching ioctl handlers list directly but rather
letting code responsible for registration call the matching cleanup
routine itself.

Fixes: 8dedcc3eee3ac ("iio: core: centralize ioctl() calls to the main chardev")
Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Acked-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210423080244.2790-1-tomasz.duszynski@octakon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c