The following issues were found
drivers/regulator/qcom_rpm-regulator.c
1 issues
Line: 963
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!vreg)
return -ENOMEM;
memcpy(vreg, reg->template, sizeof(*vreg));
mutex_init(&vreg->lock);
vreg->dev = &pdev->dev;
vreg->resource = reg->resource;
vreg->rpm = rpm;
Reported by FlawFinder.
drivers/regulator/qcom-rpmh-regulator.c
1 issues
Line: 418
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 struct rpmh_vreg_init_data *pmic_rpmh_data)
{
struct regulator_config reg_config = {};
char rpmh_resource_name[20] = "";
const struct rpmh_vreg_init_data *rpmh_data;
struct regulator_init_data *init_data;
struct regulator_dev *rdev;
int ret;
Reported by FlawFinder.
drivers/regulator/pv88080-regulator.c
1 issues
Line: 113
static const struct pv88080_compatible_regmap pv88080_aa_regs = {
/* BUCK1 */
.buck_regmap[0] = {
.buck_enable_reg = PV88080AA_REG_BUCK1_CONF0,
.buck_vsel_reg = PV88080AA_REG_BUCK1_CONF0,
.buck_mode_reg = PV88080AA_REG_BUCK1_CONF1,
.buck_limit_reg = PV88080AA_REG_BUCK1_CONF1,
.buck_vdac_range_reg = PV88080AA_REG_BUCK1_CONF2,
Reported by Cppcheck.
drivers/s390/block/dasd_erp.c
1 issues
Line: 65
Column: 2
CWE codes:
120
cqr->data = data;
memset(cqr->data, 0, datasize);
}
strncpy((char *) &cqr->magic, magic, 4);
ASCEBC((char *) &cqr->magic, 4);
set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
dasd_get_device(device);
return cqr;
}
Reported by FlawFinder.
drivers/regulator/mc13892-regulator.c
1 issues
Line: 583
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
mc13xxx_unlock(mc13892);
/* update mc13892_vcam ops */
memcpy(&mc13892_vcam_ops, mc13892_regulators[MC13892_VCAM].desc.ops,
sizeof(struct regulator_ops));
mc13892_vcam_ops.set_mode = mc13892_vcam_set_mode;
mc13892_vcam_ops.get_mode = mc13892_vcam_get_mode;
mc13892_regulators[MC13892_VCAM].desc.ops = &mc13892_vcam_ops;
Reported by FlawFinder.
drivers/regulator/max8997-regulator.c
1 issues
Line: 1047
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
max8997->buck1_gpiodvs = pdata->buck1_gpiodvs;
max8997->buck2_gpiodvs = pdata->buck2_gpiodvs;
max8997->buck5_gpiodvs = pdata->buck5_gpiodvs;
memcpy(max8997->buck125_gpios, pdata->buck125_gpios, sizeof(int) * 3);
max8997->ignore_gpiodvs_side_effect = pdata->ignore_gpiodvs_side_effect;
nr_dvs = (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs ||
pdata->buck5_gpiodvs) ? 8 : 1;
Reported by FlawFinder.
drivers/regulator/ltc3676.c
1 issues
Line: 314
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
ltc3676->dev = dev;
descs = ltc3676->regulator_descs;
memcpy(descs, ltc3676_regulators, sizeof(ltc3676_regulators));
descs[LTC3676_LDO3].fixed_uV = 1800000; /* LDO3 is fixed 1.8V */
ltc3676->regmap = devm_regmap_init_i2c(client, <c3676_regmap_config);
if (IS_ERR(ltc3676->regmap)) {
ret = PTR_ERR(ltc3676->regmap);
Reported by FlawFinder.
drivers/s390/block/dasd_ioctl.c
1 issues
Line: 503
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
dasd_info->features |=
((base->features & DASD_FEATURE_READONLY) != 0);
memcpy(dasd_info->type, base->discipline->name, 4);
spin_lock_irqsave(&block->queue_lock, flags);
list_for_each(l, &base->ccw_queue)
dasd_info->chanq_len++;
spin_unlock_irqrestore(&block->queue_lock, flags);
Reported by FlawFinder.
drivers/regulator/ltc3589.c
1 issues
Line: 402
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
ltc3589->dev = dev;
descs = ltc3589->regulator_descs;
memcpy(descs, ltc3589_regulators, sizeof(ltc3589_regulators));
if (ltc3589->variant == LTC3589) {
descs[LTC3589_LDO3].fixed_uV = 1800000;
descs[LTC3589_LDO4].volt_table = ltc3589_ldo4;
} else {
descs[LTC3589_LDO3].fixed_uV = 2800000;
Reported by FlawFinder.
drivers/scsi/fnic/fnic_scsi.c
1 issues
Line: 282
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
eth_broadcast_addr(gw_mac);
format = FCPIO_FLOGI_REG_DEF_DEST;
} else {
memcpy(gw_mac, fnic->ctlr.dest_addr, ETH_ALEN);
format = FCPIO_FLOGI_REG_GW_DEST;
}
if ((fnic->config.flags & VFCF_FIP_CAPABLE) && !fnic->ctlr.map_dest) {
fnic_queue_wq_copy_desc_fip_reg(wq, SCSI_NO_TAG,
Reported by FlawFinder.