The following issues were found

drivers/iio/chemical/sps30.c
1 issues
sprintf - Does not check for buffer overflows
Security

Line: 224 Column: 9 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              	if (ret)
		return ret;

	return sprintf(buf, "%d\n", be32_to_cpu(val));
}

static ssize_t cleaning_period_store(struct device *dev, struct device_attribute *attr,
				     const char *buf, size_t len)
{

            

Reported by FlawFinder.

drivers/hwmon/tmp103.c
1 issues
sprintf - Does not check for buffer overflows
Security

Line: 66 Column: 9 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              	if (ret < 0)
		return ret;

	return sprintf(buf, "%d\n", tmp103_reg_to_mc(regval));
}

static ssize_t tmp103_temp_store(struct device *dev,
				 struct device_attribute *attr,
				 const char *buf, size_t count)

            

Reported by FlawFinder.

drivers/hwmon/tc74.c
1 issues
sprintf - Does not check for buffer overflows
Security

Line: 95 Column: 9 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              	if (ret)
		return ret;

	return sprintf(buf, "%d\n", data->temp_input * 1000);
}
static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0);

static struct attribute *tc74_attrs[] = {
	&sensor_dev_attr_temp1_input.dev_attr.attr,

            

Reported by FlawFinder.

drivers/hwmon/sch5627.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 62 Column: 14 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              	1, 0, 1, 0, 1 };
static const u16 SCH5627_REG_IN_FACTOR[SCH5627_NO_IN] = {
	10745, 3660, 9765, 10745, 3660 };
static const char * const SCH5627_IN_LABELS[SCH5627_NO_IN] = {
	"VCC", "VTT", "VBAT", "VTR", "V_IN" };

struct sch5627_data {
	unsigned short addr;
	u8 control;

            

Reported by FlawFinder.

drivers/iommu/omap-iommu-debug.c
1 issues
snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 35 Column: 11 CWE codes: 134
Suggestion: Use a constant for the format specification

              		ssize_t bytes;						\
		const char *str = "%20s: %08x\n";			\
		const int maxcol = 32;					\
		bytes = snprintf(p, maxcol, str, __stringify(name),	\
				 iommu_read_reg(obj, MMU_##name));	\
		p += bytes;						\
		len -= bytes;						\
		if (len < maxcol)					\
			goto out;					\

            

Reported by FlawFinder.

drivers/mailbox/mailbox.c
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 422 Column: 33 CWE codes: 126

              	}

	of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
		if (!strncmp(name, mbox_name, strlen(name)))
			return mbox_request_channel(cl, index);
		index++;
	}

	dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",

            

Reported by FlawFinder.

drivers/iio/common/scmi_sensors/scmi_iio.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 136 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              	const unsigned long UHZ_PER_HZ = 1000000UL;
	u64 sec, mult, uHz, sf;
	u32 sensor_config;
	char buf[32];

	int err = sensor->sensor_ops->config_get(sensor->ph,
						 sensor->sensor_info->id,
						 &sensor_config);
	if (err) {

            

Reported by FlawFinder.

drivers/hwmon/pmbus/ucd9200.c
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 97 Column: 45 CWE codes: 126

              	dev_info(&client->dev, "Device ID %s\n", block_buffer);

	for (mid = ucd9200_id; mid->name[0]; mid++) {
		if (!strncasecmp(mid->name, block_buffer, strlen(mid->name)))
			break;
	}
	if (!mid->name[0]) {
		dev_err(&client->dev, "Unsupported device\n");
		return -ENODEV;

            

Reported by FlawFinder.

drivers/hwmon/pmbus/tps53679.c
1 issues
syntax error: { . format
Error

Line: 207

              }

static struct pmbus_driver_info tps53679_info = {
	.format[PSC_VOLTAGE_IN] = linear,
	.format[PSC_VOLTAGE_OUT] = vid,
	.format[PSC_TEMPERATURE] = linear,
	.format[PSC_CURRENT_OUT] = linear,
	.format[PSC_POWER] = linear,
	.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_PIN |

            

Reported by Cppcheck.

drivers/iio/dac/ad5592r-base.c
1 issues
sprintf - Does not check for buffer overflows
Security

Line: 478 Column: 9 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              {
	struct ad5592r_state *st = iio_priv(iio_dev);

	return sprintf(buf, "%d.%09u %d.%09u\n",
		st->scale_avail[0][0], st->scale_avail[0][1],
		st->scale_avail[1][0], st->scale_avail[1][1]);
}

static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {

            

Reported by FlawFinder.