The following issues were found
sound/soc/codecs/cx2072x.c
1 issues
Line: 503
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
buf[0] = reg >> 8;
buf[1] = reg & 0xff;
memcpy(buf + 2, val, val_count);
ret = i2c_master_send(client, buf, val_count + 2);
if (ret != val_count + 2) {
dev_err(dev, "I2C write failed, ret = %d\n", ret);
return ret < 0 ? ret : -EIO;
Reported by FlawFinder.
sound/soc/codecs/da7213.c
1 issues
Line: 1944
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
regulator_bulk_disable(DA7213_NUM_SUPPLIES, da7213->supplies);
}
static const char *da7213_supply_names[DA7213_NUM_SUPPLIES] = {
[DA7213_SUPPLY_VDDA] = "VDDA",
[DA7213_SUPPLY_VDDIO] = "VDDIO",
};
static int da7213_i2c_probe(struct i2c_client *i2c,
Reported by FlawFinder.
net/rxrpc/local_object.c
1 issues
Line: 95
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
spin_lock_init(&local->lock);
rwlock_init(&local->services_lock);
local->debug_id = atomic_inc_return(&rxrpc_debug_id);
memcpy(&local->srx, srx, sizeof(*srx));
local->srx.srx_service = 0;
trace_rxrpc_local(local->debug_id, rxrpc_local_new, 1, NULL);
}
_leave(" = %p", local);
Reported by FlawFinder.
sound/soc/codecs/da7219.c
1 issues
Line: 1845
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
return 0;
}
static const char *da7219_supply_names[DA7219_NUM_SUPPLIES] = {
[DA7219_SUPPLY_VDD] = "VDD",
[DA7219_SUPPLY_VDDMIC] = "VDDMIC",
[DA7219_SUPPLY_VDDIO] = "VDDIO",
};
Reported by FlawFinder.
sound/soc/codecs/dmic.c
1 issues
Line: 162
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!dai_drv)
return -ENOMEM;
memcpy(dai_drv, &dmic_dai, sizeof(*dai_drv));
dai_drv->capture.channels_max = chans;
}
}
return devm_snd_soc_register_component(&pdev->dev,
Reported by FlawFinder.
sound/soc/codecs/es8316.c
1 issues
Line: 58
static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_target_tlv, -1650, 150, 0);
static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(hpmixer_gain_tlv,
0, 4, TLV_DB_SCALE_ITEM(-1200, 150, 0),
8, 11, TLV_DB_SCALE_ITEM(-450, 150, 0),
);
static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(adc_pga_gain_tlv,
0, 0, TLV_DB_SCALE_ITEM(-350, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(0, 0, 0),
Reported by Cppcheck.
sound/soc/codecs/es8328.c
1 issues
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
};
/* vddd is optional supply */
static const char * const supply_names[ES8328_SUPPLY_NUM] = {
"DVDD",
"AVDD",
"PVDD",
"HPVDD",
};
Reported by FlawFinder.
sound/soc/codecs/hdac_hda.c
1 issues
Line: 302
Column: 25
CWE codes:
362
hda_stream = &pcm->stream[substream->stream];
return hda_stream->ops.open(hda_stream, &hda_pvt->codec, substream);
}
static void hdac_hda_dai_close(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
Reported by FlawFinder.
net/sctp/sm_statefuns.c
1 issues
Line: 1315
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
struct sctp_af *af = sctp_get_af_specific(ssa->v4.sin_family);
union sctp_addr_param *addrparm;
struct sctp_errhdr *errhdr;
char buffer[sizeof(*errhdr) + sizeof(*addrparm)];
struct sctp_endpoint *ep;
struct sctp_packet *pkt;
int len;
/* Build the error on the stack. We are way to malloc crazy
Reported by FlawFinder.
sound/soc/sof/intel/hda.c
1 issues
Line: 381
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
/* dump the first 8 dwords representing the extended ROM status */
static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev, u32 flags)
{
char msg[128];
int len = 0;
u32 value;
int i;
for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
Reported by FlawFinder.