Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 1/3] iio: imu: adis16480: fix unprotected debugfs reads
@ 2026-08-14  9:07 Arka Mondal
  2026-08-14  9:07 ` [PATCH 2/3] iio: imu: adis16400: " Arka Mondal
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Arka Mondal @ 2026-08-14  9:07 UTC (permalink / raw)
  To: nuno.sa, Michael.Hennerich, jic23
  Cc: dlechner, andy, venkat.prashanth2498, rohitsarkar5398, linux,
	linux-iio, linux-kernel, Arka Mondal

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>
---
Compile tested only; no relevant hardware available.

 drivers/iio/imu/adis16480.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index e009f3824768..254b7ff25b66 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -309,9 +309,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);
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-24  8:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  9:07 [PATCH 1/3] iio: imu: adis16480: fix unprotected debugfs reads Arka Mondal
2026-08-14  9:07 ` [PATCH 2/3] iio: imu: adis16400: " Arka Mondal
2026-08-15  8:42   ` Andy Shevchenko
2026-08-22 21:37     ` Jonathan Cameron
2026-08-24  8:29       ` Andy Shevchenko
2026-08-14  9:07 ` [PATCH 3/3] iio: gyro: adis16136: " Arka Mondal
2026-08-15  8:49   ` Andy Shevchenko
2026-08-22 21:39     ` Jonathan Cameron
2026-08-15  8:47 ` [PATCH 1/3] iio: imu: adis16480: " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox