* patch "iio: light: opt4001: Reject integration times with a non-zero seconds" added to char-misc-testing
@ 2026-08-19 7:44 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-08-19 7:44 UTC (permalink / raw)
To: nikhilgtr, Stable, andriy.shevchenko, jonathan.cameron
This is a note to let you know that I've just added the patch titled
iio: light: opt4001: Reject integration times with a non-zero seconds
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the char-misc-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
From d0f21621f8b2b46661ea066d20705dbf7253db87 Mon Sep 17 00:00:00 2001
From: Nikhil Gautam <nikhilgtr@gmail.com>
Date: Tue, 14 Jul 2026 17:01:33 +0530
Subject: iio: light: opt4001: Reject integration times with a non-zero seconds
part
opt4001_write_raw() only looks at val2 when setting the integration
time, so a write such as 1.000600 is silently accepted as 600 us.
Return -EINVAL if val is non-zero.
Fixes: 9a9608418292 ("iio: light: Add support for TI OPT4001 light sensor")
Signed-off-by: Nikhil Gautam <nikhilgtr@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>
---
drivers/iio/light/opt4001.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/light/opt4001.c b/drivers/iio/light/opt4001.c
index 944923cb8f28..2448d6330489 100644
--- a/drivers/iio/light/opt4001.c
+++ b/drivers/iio/light/opt4001.c
@@ -269,6 +269,9 @@ static int opt4001_write_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_INT_TIME:
+ if (val)
+ return -EINVAL;
+
int_time = opt4001_als_time_to_index(val2);
if (int_time < 0)
return int_time;
--
2.55.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-19 7:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 7:44 patch "iio: light: opt4001: Reject integration times with a non-zero seconds" added to char-misc-testing gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox