Skip to content

Commit

Permalink
iio: Remove debugfs entries in iio_device_unregister()
Browse files Browse the repository at this point in the history
Remove the the debugfs entries in iio_device_unregister(). Otherwise the debugfs
entries might still be accessible even though the device used in the debugfs
callback has already been freed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Sep 30, 2013
1 parent d3789c3 commit bc4c961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ static void iio_dev_release(struct device *device)
iio_device_unregister_trigger_consumer(indio_dev);
iio_device_unregister_eventset(indio_dev);
iio_device_unregister_sysfs(indio_dev);
iio_device_unregister_debugfs(indio_dev);

ida_simple_remove(&iio_ida, indio_dev->id);
kfree(indio_dev);
Expand Down Expand Up @@ -1087,6 +1086,7 @@ void iio_device_unregister(struct iio_dev *indio_dev)

if (indio_dev->chrdev.dev)
cdev_del(&indio_dev->chrdev);
iio_device_unregister_debugfs(indio_dev);

iio_disable_all_buffers(indio_dev);

Expand Down

0 comments on commit bc4c961

Please sign in to comment.