The following issues were found
drivers/hwmon/pmbus/stpddc60.c
1 issues
Line: 214
Column: 42
CWE codes:
126
return status;
}
for (mid = stpddc60_id; mid->name[0]; mid++) {
if (!strncasecmp(mid->name, device_id, strlen(mid->name)))
break;
}
if (!mid->name[0]) {
dev_err(&client->dev, "Unsupported device\n");
return -ENODEV;
Reported by FlawFinder.
drivers/gpu/drm/exynos/exynos_drm_dsi.c
1 issues
Line: 215
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
#define OLD_SCLK_MIPI_CLK_NAME "pll_clk"
static const char *const clk_names[5] = { "bus_clk", "sclk_mipi",
"phyclk_mipidphy0_bitclkdiv8", "phyclk_mipidphy0_rxclkesc0",
"sclk_rgb_vclk_to_dsim0" };
enum exynos_dsi_transfer_type {
EXYNOS_DSI_TX,
Reported by FlawFinder.
drivers/hwmon/pmbus/pim4328.c
1 issues
Line: 159
Column: 42
CWE codes:
126
return status;
}
for (mid = pim4328_id; mid->name[0]; mid++) {
if (!strncasecmp(mid->name, device_id, strlen(mid->name)))
break;
}
if (!mid->name[0]) {
dev_err(&client->dev, "Unsupported device\n");
return -ENODEV;
Reported by FlawFinder.
drivers/iio/dac/ad8801.c
1 issues
Line: 23
Column: 11
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
struct ad8801_state {
struct spi_device *spi;
unsigned char dac_cache[8]; /* Value write on each channel */
unsigned int vrefh_mv;
unsigned int vrefl_mv;
struct regulator *vrefh_reg;
struct regulator *vrefl_reg;
Reported by FlawFinder.
drivers/gpu/drm/i915/i915_cmd_parser.c
1 issues
Line: 1205
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
if (src_needs_clflush)
drm_clflush_virt_range(src + x, len);
memcpy(ptr, src + x, len);
kunmap_atomic(src);
ptr += len;
remain -= len;
x = 0;
Reported by FlawFinder.
drivers/iio/frequency/adf4350.c
1 issues
Line: 350
Column: 25
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
}
mutex_unlock(&st->lock);
return ret < 0 ? ret : sprintf(buf, "%llu\n", val);
}
#define _ADF4350_EXT_INFO(_name, _ident) { \
.name = _name, \
.read = adf4350_read, \
Reported by FlawFinder.
drivers/irqchip/irq-gic-v2m.c
1 issues
Line: 333
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
v2m->fwnode = fwnode;
v2m->flags = flags;
memcpy(&v2m->res, res, sizeof(struct resource));
v2m->base = ioremap(v2m->res.start, resource_size(&v2m->res));
if (!v2m->base) {
pr_err("Failed to map GICv2m resource\n");
ret = -ENOMEM;
Reported by FlawFinder.
drivers/irqchip/irq-gic-v3-its.c
1 issues
Line: 261
CWE codes:
908
static int vpe_to_cpuid_lock(struct its_vpe *vpe, unsigned long *flags)
{
raw_spin_lock_irqsave(&vpe->vpe_lock, *flags);
return vpe->col_idx;
}
static void vpe_to_cpuid_unlock(struct its_vpe *vpe, unsigned long flags)
{
Reported by Cppcheck.
drivers/iio/health/max30102.c
1 issues
Line: 257
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
#define MAX30102_COPY_DATA(i) \
memcpy(&data->processed_buffer[(i)], \
&buffer[(i) * MAX30102_REG_FIFO_DATA_BYTES], \
MAX30102_REG_FIFO_DATA_BYTES)
static int max30102_read_measurement(struct max30102_data *data,
unsigned int measurements)
Reported by FlawFinder.
drivers/iio/humidity/dht11.c
1 issues
Line: 125
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
static int dht11_decode(struct dht11 *dht11, int offset)
{
int i, t;
char bits[DHT11_BITS_PER_READ];
unsigned char temp_int, temp_dec, hum_int, hum_dec, checksum;
for (i = 0; i < DHT11_BITS_PER_READ; ++i) {
t = dht11->edges[offset + 2 * i + 2].ts -
dht11->edges[offset + 2 * i + 1].ts;
Reported by FlawFinder.