The following issues were found
drivers/clk/ingenic/cgu.c
1 issues
Line: 623
Column: 8
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 clk_init_data clk_init;
struct ingenic_clk *ingenic_clk = NULL;
struct clk *clk, *parent;
const char *parent_names[4];
unsigned caps, i, num_possible;
int err = -EINVAL;
BUILD_BUG_ON(ARRAY_SIZE(clk_info->parents) > ARRAY_SIZE(parent_names));
Reported by FlawFinder.
drivers/clk/keystone/pll.c
1 issues
Line: 302
Column: 8
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
void __iomem *reg;
u32 shift, mask;
struct clk *clk;
const char *parents[2];
const char *clk_name = node->name;
of_property_read_string(node, "clock-output-names", &clk_name);
reg = of_iomap(node, 0);
if (!reg) {
Reported by FlawFinder.
drivers/clk/meson/sclk-div.c
1 issues
Line: 131
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct meson_sclk_div_data *sclk = meson_sclk_div_data(clk);
if (MESON_PARM_APPLICABLE(&sclk->hi)) {
memcpy(&sclk->cached_duty, duty, sizeof(*duty));
sclk_apply_ratio(clk, sclk);
}
return 0;
}
Reported by FlawFinder.
drivers/clk/mmp/clk-mix.c
1 issues
Line: 465
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
init.num_parents = num_parents;
init.ops = &mmp_clk_mix_ops;
memcpy(&mix->reg_info, &config->reg_info, sizeof(config->reg_info));
if (config->table) {
table_bytes = sizeof(*config->table) * config->table_size;
mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL);
if (!mix->table)
goto free_mix;
Reported by FlawFinder.
drivers/clk/mvebu/clk-cpu.c
1 issues
Line: 208
Column: 3
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
if (WARN_ON(err))
goto bail_out;
sprintf(clk_name, "cpu%d", cpu);
cpuclk[cpu].parent_name = of_clk_get_parent_name(node, 0);
cpuclk[cpu].clk_name = clk_name;
cpuclk[cpu].cpu = cpu;
cpuclk[cpu].reg_base = clock_complex_base;
Reported by FlawFinder.
drivers/clk/mvebu/cp110-system-controller.c
1 issues
Line: 227
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 clk_hw *hw, **cp110_clks;
u32 nand_clk_ctrl;
int i, ret;
char *gate_name[ARRAY_SIZE(gate_base_names)];
regmap = syscon_node_to_regmap(syscon_node);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
Reported by FlawFinder.
drivers/clk/mvebu/dove-divider.c
1 issues
Line: 165
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 dove_clk *dc, const char **parent_names, size_t num_parents,
void __iomem *base)
{
char name[32];
struct clk_init_data init = {
.name = name,
.ops = &dove_divider_ops,
.parent_names = parent_names,
.num_parents = num_parents,
Reported by FlawFinder.
drivers/clk/nxp/clk-lpc32xx.c
1 issues
Line: 1386
Column: 8
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 clk_proto_t *lpc32xx_clk = &clk_proto[id];
struct clk_hw_proto *clk_hw = &clk_hw_proto[id];
const char *parents[LPC32XX_CLK_PARENTS_MAX];
struct clk *clk;
unsigned int i;
for (i = 0; i < lpc32xx_clk->num_parents; i++)
parents[i] = clk_proto[lpc32xx_clk->parents[i]].name;
Reported by FlawFinder.
drivers/clk/pxa/clk-pxa3xx.c
1 issues
Line: 38
Column: 17
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
};
/* crystal frequency to HSIO bus frequency multiplier (HSS) */
static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
/* crystal frequency to static memory controller multiplier (SMCFS) */
static unsigned int smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
static unsigned int df_clkdiv[4] = { 1, 2, 4, 1 };
Reported by FlawFinder.
drivers/clk/qcom/clk-spmi-pmic-div.c
1 issues
Line: 209
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 device_node *of_node = dev->of_node;
const char *parent_name;
int nclks, i, ret, cxo_hz;
char name[20];
u32 start;
ret = of_property_read_u32(of_node, "reg", &start);
if (ret < 0) {
dev_err(dev, "reg property reading failed\n");
Reported by FlawFinder.