Skip to contentSkip to conversation

patch "iio: adc: pac1934: check ACPI label duplication" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Oct 1

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: adc: pac1934: check ACPI label duplication

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-linus 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 hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 64c82e7bd9c82b0c9276297df34a3579e8658f55 Mon Sep 17 00:00:00 2001
From: Slavin Liu <[email protected]>
Date: Sun, 13 Sep 2026 20:51:07 +0800
Subject: iio: adc: pac1934: check ACPI label duplication

A label duplication failure currently reaches the terminating-byte write. Release the ACPI result and abort before accessing the missing label; earlier labels are managed by devres.

Detected by static analysis and reviewed with AI-assisted source auditing.

Fixes 0fb528c8255b ("iio: adc: adding support for PAC193x")
Assisted-by LLM
---
 drivers/iio/adc/pac1934.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iio/adc/pac1934.c +4 -0
index 23055405a6e0..de59dc27c440 100644
@@ -1108,6 +1108,10 @@ static int pac1934_acpi_parse_channel_config(struct i2c_client *client,
 			devm_kmemdup(dev, rez->package.elements[i].string.pointer,
 				     (size_t)rez->package.elements[i].string.length + 1,
 				     GFP_KERNEL);
+		if (!info->labels[idx]) {
+			ACPI_FREE(rez);
+			return -ENOMEM;
+		}
 		info->labels[idx][rez->package.elements[i].string.length] = '\0';
 		info->shunts[idx] = rez->package.elements[i + 1].integer.value * 1000;
 		info->active_channels[idx] = (info->shunts[idx] != 0);
Signature · 1 line
2.56.0