Skip to contentSkip to conversation

iio: imu: inv_icm45600: Initializes inv_icm45600_buffer_postdisable sleep

PATCH Applied Remi Buisson 3 participants 3 messages Nov 7, 2025 – Nov 9, 2025

Subsystems (2)

v4 of 5 Applied Latest is v5 →

lore
Share & tools
lore

Remi Buisson

author maintainer
#0 lore raw

PATCH v4 1/1 iio: imu: inv_icm45600: Initializes inv_icm45600_buffer_postdisable sleep

The sleep variable in inv_icm45600_buffer_postdisable could be used without being assigned in case of error. It must be initialized to 0 by default.

Fixes 06674a72cf7a ("iio: imu: inv_icm45600: add buffer support in iio devices")

---
Changes in v4:
- Add space in closse tag in commit message
- Remove extra blank line in commit message
- Link to v3: https://lore.kernel.org/r/20251106-icm45600_fix_buffer_sleep_init-v3-1-ea3af68a3e61@tdk.com

Changes in v3:
- Fix commit message: fix and closes moved to SoB
- Fix assignement of sleep variable after declaration.
- Link to v2: https://lore.kernel.org/r/20251031-icm45600_fix_buffer_sleep_init-v2-1-5cdc04e1bcba@tdk.com

Changes in v2:
- Moving pacth description from cover-letter to single commit
- Link to v1: https://lore.kernel.org/r/20251031-icm45600_fix_buffer_sleep_init-v1-1-924efbb165e8@tdk.com

---
 drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c +1 -0
index 2efcc177f9d60a6a2509e448c0ddaf4b9e1fd755..2b9ea317385ceb680f013c4c1b2a6a74fbe5d7e7 100644
@@ -370,6 +370,7 @@ static int inv_icm45600_buffer_postdisable(struct iio_dev *indio_dev)
 		return -EINVAL;
 	}
 
+	sleep = 0;
 	scoped_guard(mutex, &st->lock)
 		ret = _inv_icm45600_buffer_postdisable(st, sensor, watermark, &sleep);
 

---
base-commit: 70437bbd7529e9860fb7f0c92a89e0e6abaa994e
change-id: 20251031-icm45600_fix_buffer_sleep_init-8062f6e07f84

Best regards,

Signature · 1 line
Remi Buisson <[email protected]>
Reviewed-by on v4 1/1
#1 lore raw
Quoted 2 lines · On Fri, Nov 07, 2025 at 09:13:58AM +0000, Remi Buisson via B4 Relay wrote:

The sleep variable in inv_icm45600_buffer_postdisable could be used without

inv_icm45600_buffer_postdisable()

Quoted 1 line

being assigned in case of error. It must be initialized to 0 by default.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#2 lore raw
In reply to Remi Buisson
Quoted 7 lines · On Fri, 07 Nov 2025 09:13:58 +0000 Remi Buisson via B4 Relay…

From: Remi Buisson <[email protected]>

The sleep variable in inv_icm45600_buffer_postdisable could be used without being assigned in case of error. It must be initialized to 0 by default.

Fixes 06674a72cf7a ("iio: imu: inv_icm45600: add buffer support in iio devices")

I added a reported-by for Dan as well based on that link.

Applied to the togreg branch of iio.git as this is new code we are fixing from this cycle.

Thanks,

Jonathan

Quoted 37 lines

---
Changes in v4:
- Add space in closse tag in commit message
- Remove extra blank line in commit message
- Link to v3: https://lore.kernel.org/r/20251106-icm45600_fix_buffer_sleep_init-v3-1-ea3af68a3e61@tdk.com

Changes in v3:
- Fix commit message: fix and closes moved to SoB
- Fix assignement of sleep variable after declaration.
- Link to v2: https://lore.kernel.org/r/20251031-icm45600_fix_buffer_sleep_init-v2-1-5cdc04e1bcba@tdk.com

Changes in v2:
- Moving pacth description from cover-letter to single commit
- Link to v1: https://lore.kernel.org/r/20251031-icm45600_fix_buffer_sleep_init-v1-1-924efbb165e8@tdk.com

---
 drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/imu/inv_icm45600/inv_icm45600_buffer.c +1 -1
index 2efcc177f9d60a6a2509e448c0ddaf4b9e1fd755..2b9ea317385ceb680f013c4c1b2a6a74fbe5d7e7 100644
@@ -370,6 +370,7 @@ static int inv_icm45600_buffer_postdisable(struct iio_dev *indio_dev)
 		return -EINVAL;
 	}
 
+	sleep = 0;
 	scoped_guard(mutex, &st->lock)
 		ret = _inv_icm45600_buffer_postdisable(st, sensor, watermark, &sleep);
 
 
---

base-commit: 70437bbd7529e9860fb7f0c92a89e0e6abaa994e
change-id: 20251031-icm45600_fix_buffer_sleep_init-8062f6e07f84

Best regards,