summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorArka Mondal <arkamondalofficial@gmail.com>2026-08-16 03:27:24 +0900
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-08-22 22:46:10 +0100
commit9929e3f5c7ffb07d4c161ad6fc0cc7d09ff75ce8 (patch)
tree869085061a58628306a04eb2985b0ef1e22824aa /drivers
parent4e69b79d8b0cfe0b3edba8b9e29f10c9d7776aac (diff)
downloadlinux-next-9929e3f5c7ffb07d4c161ad6fc0cc7d09ff75ce8.tar.gz
linux-next-9929e3f5c7ffb07d4c161ad6fc0cc7d09ff75ce8.zip
iio: imu: adis16480: fix unprotected debugfs reads
The firmware_revision and firmware_date file operations are open coded and never call debugfs_file_get(), which debugfs_create_file_unsafe() requires. debugfs_remove_recursive() therefore does not wait for a read in progress, and unbind frees the iio_dev underneath it. Use debugfs_create_file() instead. Fixes: 9bf94f836e32 ("imu:adis16480: fix debugfs_simple_attr.cocci warnings") Signed-off-by: Arka Mondal <arkamondalofficial@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/imu/adis16480.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index 543d5c4bfb11..d20455816e7d 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -310,9 +310,9 @@ static void adis16480_debugfs_init(struct iio_dev *indio_dev)
if (!IS_ENABLED(CONFIG_DEBUG_FS))
return;
- debugfs_create_file_unsafe("firmware_revision", 0400,
+ debugfs_create_file("firmware_revision", 0400,
d, adis16480, &adis16480_firmware_revision_fops);
- debugfs_create_file_unsafe("firmware_date", 0400,
+ debugfs_create_file("firmware_date", 0400,
d, adis16480, &adis16480_firmware_date_fops);
debugfs_create_file_unsafe("serial_number", 0400,
d, adis16480, &adis16480_serial_number_fops);