Skip to contentSkip to conversation

patch "iio: dac: ad3552r-hs: fix uninitialized data ni" added to char-misc-testing

PATCH [email protected] 1 participant 1 message Jun 14

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: dac: ad3552r-hs: fix uninitialized data ni

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 eaaa7eef181892ef7ba56c6295b81f0ae4492c13 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Mon, 25 May 2026 10:15:46 +0300
Subject: iio: dac: ad3552r-hs: fix uninitialized data ni
ad3552r_hs_write_data_source()

If the *ppos value is non-zero then the simple_write_to_buffer() function won't initialized the start of the buf[] buffer. Non-zero values for *ppos won't work here generally, so just test for them and return -ENOSPC at the start of the function.

Fixes b1c5d68ea66e ("iio: dac: ad3552r-hs: add support for internal ramp")
---
 drivers/iio/dac/ad3552r-hs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad3552r-hs.c +1 -1
index a9578afa7015..6bc64f53bce9 100644
@@ -549,7 +549,7 @@ static ssize_t ad3552r_hs_write_data_source(struct file *f,
 
 	guard(mutex)(&st->lock);
 
-	if (count >= sizeof(buf))
+	if (*ppos != 0 || count >= sizeof(buf))
 		return -ENOSPC;
 
 	ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, userbuf,
Signature · 1 line
2.54.0